Abstract
We propose a machine learning based method of sentiment classification of sentences using word-level polarity. The polarities of words in a sentence are not always the same as that of the sentence, because there can be polarity-shifters such as negation expressions. The proposed method models the polarity-shifters. Our model can be trained in two different ways: word-wise and sentence-wise learning. In sentence-wise learning, the model can be trained so that the prediction of sentence polarities should be accurate. The model can also combined with features used in previous work such as bag-of-words and n-grams. We empirically show that our method improves the performance of sentiment classification of sentences especially when we have only small amount of training data.
Introduction
Sentiment analysis often fails when individual word polarities do not align with the overall sentence sentiment—for instance, in phrases like "not good" or "not a bad movie." Traditional "Bag-of-Words" (BoW) approaches struggle with such context, as they typically rely on fixed lexicons where a word like "excellent" is always positive. While n-gram models can capture some local context, they require vast amounts of data to learn all possible negation combinations. Furthermore, manually defining rules for "polarity shifters" (e.g., not, but, however) is difficult due to the inherent diversity of natural language.
This paper introduces a statistical model that explicitly learns to "shift" word polarities based on context. By modeling how and when a word's inherent polarity should be reversed, the proposed approach outperforms standard BoW and n-gram models, particularly in scenarios where training data is scarce.
Methodology: Word Polarity Shifting
The core contribution is a Word Polarity Shifting Model. Rather than simply aggregating word counts, the model calculates a score for each word indicating whether its polarity has been flipped based on its surroundings.
Learning Strategies
The authors propose two distinct training methods:
- Word-wise Learning: The model treats each word as an individual training instance. If a positive word appears in a negative sentence, the model attempts to identify the contextual features responsible for that flip.
- Sentence-wise Learning: A more robust approach where the model is trained to ensure the sum of all predicted word polarities in a sentence matches the overall sentence label. This allows the model to effectively ignore "noisy" or irrelevant words that do not contribute to the sentiment.
Hybrid Modeling and Features
The polarity-shifting score is integrated with traditional BoW and n-gram features into a single linear model. A parameter $\lambda$ is used to balance the contribution of the shifting model against standard features. Feature engineering involves examining a small window of words surrounding a target word to identify potential shifters (e.g., detecting "not" within three words of "good").
Experimental Results
The model was evaluated using the General Inquirer sentiment lexicon and two primary datasets: the Customer Review Dataset (1,436 sentences) and the Movie Review Dataset (9,492 sentences).
Performance Comparison
The hybrid model demonstrated superior accuracy across both datasets:
- Customer Reviews: Achieved 84.0% accuracy, significantly higher than BoW (79.0%) and 3-grams (80.0%).
- Movie Reviews: Reached 77.0% accuracy, outperforming BoW (72.4%) and 3-grams (76.2%).
The Small Data Advantage
A key finding is the model's efficiency with limited training data. As shown in the learning curves below, the sentence-wise learning model consistently outperforms n-gram models when only 100 to 1,000 labeled sentences are available. While 3-gram models eventually close the gap as data increases, the polarity-shifting model generalizes faster by learning the concept of a shifter rather than memorizing specific sequences.
Conclusion and Future Work
The proposed polarity-shifting model provides a flexible, data-efficient way to handle negations and context in sentiment analysis. By training at the sentence level, the model learns to assign appropriate weights to relevant words, acting as a "weighted majority vote" that integrates seamlessly into existing SVM or online learning frameworks.
Future improvements could include using dependency parsing to more accurately link negations to their targets, handling neutral sentences through threshold-based approaches, and scaling the model to document-level classification where sentiment may shift multiple times.
Summary updated