0Pricing
NLP Academy · Lesson

Handling Negation and Edge Cases

Fix not good and other traps.

The Negation Problem

Counting cues breaks on not good, because good still scores positive. Negation can flip a sentence and fool a naive detector.

Spot the Negators

Keep a small list of negation words like not, never, and no. When one appears, the cue right after it usually means the opposite.

negators = {"not", "never", "no", "isn't", "wasn't"}

All lessons in this course

  1. What Is Sentiment Analysis?
  2. Building a Positive and Negative Word List
  3. Scoring a Review by Counting Cues
  4. Handling Negation and Edge Cases
← Back to NLP Academy