Sentiment Analysis
What is sentiment analysis and how is it framed?
Sentiment analysis classifies the emotional polarity of text — positive, negative, or neutral. It's usually framed as a text classification problem, either binary, three-class, or fine-grained (1–5 stars).
- “Classification or regression?” — Polarity is classification; a continuous intensity score can be regression. Star ratings are often treated as ordinal.
Lexicon vs ML vs transformer approaches?
Three eras of methods, trading simplicity for accuracy and context-awareness.
Sum positive/negative word scores (e.g. VADER). No training, but blind to context.
- “Why did transformers win?” — They model word order and context, so they handle the cases bag-of-words misses.
Why are negation and sarcasm hard?
Surface words mislead. “Not good” contains a positive word but is negative; “Oh great, it broke again” is positive on the surface but sarcastic.
Count-based features ignore order and scope, so they can't see that “not” flips “good.” Sarcasm and irony often need world knowledge or tone that's absent from the text — still hard even for large models.
What is aspect-based sentiment analysis?
Instead of one label per document, aspect-based sentiment assigns polarity to specific aspects. “The food was great but the service was slow” → food: positive, service: negative.
- “Why is it useful?” — A single overall score hides actionable detail; businesses want to know what customers liked or disliked.
How do you evaluate it?
Standard classification metrics — accuracy, and precision/recall/F1 per class. Sentiment data is often imbalanced (lots of positives), so report macro-F1, not just accuracy. See classification metrics.
- “Watch-outs in labeling?” — Human annotators disagree on neutral/mixed cases; measure inter-annotator agreement and define guidelines.