Sentiment Analysis
Somewhere a company is receiving ten thousand reviews a week and nobody can read them all. Sentiment analysis is the task of deciding automatically what attitude a piece of text expresses towards its subject — positive, negative, neutral, or something on a finer scale.
Three levels of the question
The label you need decides the shape of the task:
- Document or sentence level: one verdict for the whole span, the usual framing for scoring reviews.
- Aspect-based: a verdict per aspect, because "the battery lasts for days but the screen is unreadable outdoors" is positive and negative at once, and a single label throws away the useful half.
- Emotion and intensity: beyond polarity to anger, joy or urgency — what a support queue actually routes on.
How it gets built
The cheapest approach is a sentiment lexicon: VADER scores individual words and handles intensifiers and negation by rule, with no training data at all. Supervised classifiers over TF-IDF features do better inside a specific domain, and a fine-tuned encoder such as BERT on SST-2 — the sentiment task in the GLUE benchmark — does better again, because it reads "not bad at all" in context instead of as a bag of words.
Why it is a language problem
Polarity lives in structure, not in vocabulary. Negation flips it, comparison hides it ("better than their last attempt" is not praise), and domain reverses it outright: "unpredictable" sells a thriller and condemns a car. A model trained on product reviews and pointed at clinical notes drops sharply, which is why a small labelled sample from the real domain beats a large corpus from the wrong one.
Sentiment analysis is the classification of text by the attitude it expresses towards its subject — positive, negative or neutral, at document, sentence or individual aspect level. It turns unread volumes of reviews, support tickets and social posts into countable signal. Accuracy rests on structure rather than vocabulary: negation, comparison and sarcasm invert polarity, and a model trained in one domain transfers poorly to another.
If a shop received twenty thousand reviews this month, no human could read them all. Sentiment analysis is software doing the skim: deciding whether each piece of writing sounds pleased, annoyed or neutral about whatever it is discussing.
It is harder than spotting cheerful words. "Not bad at all" is praise built out of a negative word. "Great, another delay" is a complaint dressed as a compliment. And "unpredictable" is high praise for a film but a serious worry about a car. So the software has to weigh whole sentences rather than single words, and it works best when it has learned from the same kind of writing it is being asked to judge.