← Lessons

quiz vs the machine

Gold1330

Machine Learning

The Sentiment Analysis Deep

Detecting the polarity and target of opinions in text.

4 min read · core · beat Gold to climb

What sentiment analysis does

Sentiment analysis judges the opinion expressed in text, usually as positive, negative, or neutral. It is a special text classification task with its own hard cases.

Levels of granularity

  • Document level gives one polarity for a whole review.
  • Sentence level scores each sentence separately.
  • Aspect based ties sentiment to a target, so the battery is great but the screen is dim yields two opposite aspect opinions.

Aspect based analysis is far more useful for product feedback because it separates what is praised from what is criticized.

Why it is tricky

  • Negation flips polarity: not good is negative even though good is positive.
  • Sarcasm says the opposite of the literal words, fooling shallow models.
  • Domain shift means sentiment words differ across domains, where unpredictable is bad for a car but good for a thriller.

Approaches

  • Lexicon methods sum the polarity of opinion words, simple but brittle to negation.
  • Fine tuned transformers read full context and handle negation and longer dependencies far better.

Key idea

Sentiment analysis detects opinion polarity at document, sentence, or aspect level, and the aspect view plus careful handling of negation and sarcasm separates genuine signal from noise.

Check yourself

Answer to earn rating on the learn ladder.

1. What does aspect based sentiment analysis add?

2. Why does negation challenge lexicon methods?