Natural Language Processing
NLP is a field of AI that helps computers understand, interpret, and generate human language.
- Text Classification - Sentiment Analysis - Chatbots - Translation - Speech Recognition
- NLTK - spaCy - Transformers (HuggingFace)
pip install nltk spacy transformers
from nltk.tokenize import word_tokenize text = "Hello world" tokens = word_tokenize(text) print(tokens)
from nltk.corpus import stopwords
words = ["this", "is", "good"]
filtered = [w for w in words if w not in stopwords.words('english')]
from sklearn.feature_extraction.text import CountVectorizer vec = CountVectorizer() X = vec.fit_transform(["hello world"])
from transformers import pipeline
chat = pipeline("text-generation")
print(chat("Hello AI"))