How Sentiment Analysis Works — And Why “Not Bad” Is So Hard

How Sentiment Analysis Worksl

Why counting positive words fails, how negation and word order break simple models, and what a neural model does differently. Written for people reading real feedback.

How Sentiment Analysis Works

Last Updated: August 2026

🔴 Turning Words Into a Number

Every approach to this problem, from the simplest to the most expensive, is doing the same job: converting language into one figure on a scale. The methods differ enormously in how much of the sentence they look at.

The lexicon: a very large opinionated dictionary

The oldest working method is a scored word list. Human annotators rate thousands of words on a scale — excellent lands near the top, terrible near the bottom, adequate barely off zero. Score a passage by adding up the weights of the words it contains.

It sounds too crude to be useful, and on any single sentence it can be. Across a few hundred reviews it holds up surprisingly well, because the errors are not systematic — they scatter, and the average survives. That is why lexicon scoring is still in production use decades after neural methods arrived: it is instant, needs no training data, and you can read exactly why it produced a number.

Why raw word-counting fails immediately

Add up the words in it is not bad and you get a negative. Add up I would not say this was excellent and you get a strong positive. The words are right there; the meaning is inverted. Word counting throws away word order, and word order is where a large amount of English meaning lives.

🟡 The Three Rules That Make It Work

Practical lexicon systems are not plain adders. They carry a handful of rules that patch the biggest failures, and each one is worth understanding because each one has a visible effect on the scores you will see.

Negation windows

Look backwards a few words from every scored term. If a negator sits in that window — notnevercannotwithout — flip the sign.

The subtlety is that flipping is not enough. Not good is mildly negative, but it is nowhere near as negative as terrible. When someone reaches for a negated positive rather than a direct negative, they are usually softening deliberately. So the flip carries a dampening factor of roughly three-quarters: the sign reverses and the strength drops. That is why the tool reports not good around -34 rather than the -44 you would get from a straight inversion.

Three words is the usual window. Widen it and you start catching negations that belong to a different clause entirely.

Intensity modifiers

Some words exist only to scale the word after them. Very multiplies by about 1.3, extremely by about 1.5, and slightly pulls the other way at around 0.65. Capital letters and repeated exclamation marks do the same job through typography rather than vocabulary — people reach for them when they mean it, and a system that ignores them under-reads genuinely angry feedback.

Contrast weighting

This one changes results more than the other two combined. Consider:

The food was excellent but the service was appalling

A plain sum lands near zero — one strong positive, one strong negative, cancelled. But nobody reads that sentence as neutral. English uses buthowever and although to signal that what follows is the point and what preceded it was the concession. Weighting the second half at roughly two-thirds produces a clearly negative reading, which is what the writer intended. Reverse the halves and the verdict flips, exactly as it should.

🟢 What a Neural Model Does Differently

Rules patch known failures. They cannot patch failures nobody has thought of yet, and there are a great many ways to be negative in English without using a negative word.

From words to positions in space

A neural model does not look words up in a table. It converts each token into a vector — a long list of numbers positioning that word relative to every other word it learned from. Words used in similar contexts end up near each other, so the model has a usable notion of dreadful being close to awful without anyone having written that down.

Attention: reading words in company

The important part is that these models process the sentence as a whole. Each word’s representation is adjusted by the words around it, so sick in “the app is sick, I love it” ends up somewhere completely different from sick in “I feel sick after using this”. A lexicon has one entry for the word and must pick a side.

This is what the transformer architecture made practical, and it is why a model trained on enough review text handles phrasing no rule anticipated.

What you give up

🔵 Size — tens of megabytes to download against a word list measured in kilobytes

🟠 Speed — noticeably slower per row, which matters at a thousand rows

🟣 Explainability — a lexicon can show you which words moved the score; a neural model gives you a number and no working

🔵 Domain sensitivity — trained on product reviews, it may read clinical notes or legal correspondence strangely, and it will not tell you it is out of its depth

For most feedback work the lexicon is the better default and the neural model is worth switching to when the phrasing gets unusual. Running either one inside the browser rather than calling a service is a separate decision, covered in how browser AI models actually work.

🔴 One Number Is Usually the Wrong Shape

Here is the failure that costs businesses real money, and it has nothing to do with model quality.

Averages hide the actionable part

One averaged score compared with separate scores per product feature

Imagine four hundred reviews. The screen is universally praised. The battery is universally condemned. Delivery is fine. Average it all together and you get a bland mid-score suggesting nothing is badly wrong — while four hundred people have just told you precisely what to fix.

The overall figure is not incorrect. It is answering a question nobody needed answered.

Aspect-based analysis

The alternative splits opinions by the thing they are about. Break each sentence into clauses, score each clause on its own, and attach that verdict to whatever the clause was discussing. Battery: negative. Screen: positive. Delivery: neutral.

Two ways exist to find the aspect. Grammar patterns look for a noun sitting beside an opinion, often flagged by a nearby themy or is — cheap, instant, and about as accurate as you would expect from a rule. A trained extraction model does better and costs correspondingly more. Browser tools generally use the first, which is why any honest one shows you an example sentence for each aspect it claims to have found.

Sarcasm, the problem that stays open

“Brilliant, another update that breaks everything.” Every word is positive except the ones describing the failure, and the sentence means the opposite of its vocabulary. Detecting this needs a model of what the speaker actually believes, not just what they typed. Published detectors do markedly better than chance on datasets built for the purpose and markedly worse on real feedback in the wild.

The practical response is not a better tool. It is to use sentiment scores for triage — sort, filter, spot the trend — and to read the outliers yourself before acting on them.

🟡 Using the Numbers Honestly

Three habits keep this useful. Never trust a score from a handful of rows: a health figure from twelve reviews is an accident, not a measurement. Never trust a score from a very short text, where one adjective controls everything. And check the working when a tool offers it — a score you can trace to specific words is one you can argue with, which is exactly what you want from a number you plan to act on.

The Sentiment & Brand Studio shows the words behind every score and breaks feedback down by aspect, both in the browser with nothing uploaded. For the broader field, Wikipedia’s sentiment analysis article is a good next stop.

❓ Frequently Asked Questions

What is a sentiment lexicon?

A list of words with numeric weights assigned by human raters. Scoring a passage means adding up the weights of the words in it, then adjusting for context.

Why is “not bad” so difficult?

The only loaded word is negative, so plain counting gets it backwards. It needs a rule that looks behind each word for a negator and flips the sign while reducing the strength.

Is a neural model always more accurate?

On unusual phrasing, generally yes. On straightforward reviews the gap narrows, and the lexicon is faster and can show its working. Domain mismatch hurts both.

Why does the same word score differently in two sentences?

Context modifiers. Negation, intensifiers, capital letters and a preceding contrast word all change the weight a term contributes to the total.

What is aspect-based sentiment analysis?

Scoring opinions against the feature they refer to rather than the review as a whole, so a poor battery and a good screen appear as two verdicts instead of one average.

Can any tool detect sarcasm reliably?

No. It requires knowing what the speaker believes, not just what they wrote. Detectors do well on purpose-built datasets and much worse on genuine feedback.

How much text is enough for a trustworthy score?

Around fifteen words for a single passage, and around fifty rows before an aggregate figure is worth quoting. Below that the numbers move on noise.

Do these models work outside English?

Multilingual models exist but are noticeably weaker, and lexicons rarely transfer at all. For a non-English corpus, translating first usually beats scoring it directly.

Why run sentiment analysis in the browser?

Customer feedback often contains names, order numbers and complaints. Scoring it locally means none of that is posted to a third-party service to be logged.

Choose a language

Top Tools Ranking

Network Total Views
14,348
Tracking Since
Jul 9, 2026

Click any tool to open in a new window