Class Notes: Sentiment Analysis in NLP
1. Overview
Sentiment Analysis (Opinion Mining) is the computational study of opinions, sentiments, and emotions
expressed in text.
2. Approaches
• Rule-based: Uses sentiment lexicons and linguistic rules.
• Machine Learning: Classical algorithms (SVM, Naive Bayes) with feature engineering.
• Deep Learning: CNNs, RNNs, Transformers (BERT, RoBERTa).
3. Preprocessing Steps
• Tokenization
• Stopword Removal
• Stemming/Lemmatization
• Handling Negations
4. Feature Representation
Representation Description
Bag of Words Word frequency vectors
TF-IDF Term frequency-inverse document frequency
Word Embeddings Dense vectors (Word2Vec, GloVe)
Contextual Embeddings Transformer-based embeddings (BERT)
5. Evaluation Metrics
• Accuracy
• Precision, Recall, F1-Score
• ROC-AUC
6. Applications
• Customer Feedback Analysis
• Social Media Monitoring
• Market Research
• Product Reviews
Generated for educational purposes