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
- What Is Sentiment Analysis?
- Building a Positive and Negative Word List
- Scoring a Review by Counting Cues
- Handling Negation and Edge Cases