# Thumbs up? Sentiment Classification using Machine Learning Techniques

Standard classifiers can sort movie reviews by sentiment using word features

Bo Pang, Lillian Lee, Shivakumar Vaithyanathan · arXiv · 2002-5-28

- **Problem** Sorting documents by sentiment is harder than sorting them by topic, and word lists picked by hand performed poorly. Researchers had not shown how well standard learners handle this task.
- **Method** The authors train Naive Bayes, Maximum Entropy and support vector machines on presence-based unigram features with negation tags. They evaluate on 700 positive and 700 negative movie reviews.
- **Results** Support vector machines with unigram presence features reached 82.9 percent accuracy. This beat the human-chosen word lists at 58% and 64%, and the corpus-informed list at 69%.

## Sentiment is not the same task as topic sorting

Most text categorization work sorts documents by subject, for example sports versus politics. Sentiment classification asks a different question: what overall opinion a document expresses, such as whether a product review is positive or negative. The problem matters for review sites, business intelligence, recommender systems, and filtering hostile messages out of discussion groups.

Topics usually leave keyword traces, whereas opinion can be carried by wording that contains no obviously negative term. A rhetorical question about sitting through a film carries clear negativity without containing any single negative word. Sentiment therefore appears to need more understanding than topic labelling does, which is why the study also examines how hard the task is.

Earlier sentiment work often relied on knowledge supplied in advance, such as semantic orientation of words from seed sets or hand-built lexicons of discriminant words. Turney's unsupervised method, which uses search-engine statistics on the words excellent and poor, is the closest prior work. This study instead applies supervised learners that receive no prior linguistic knowledge, to measure how difficult the task is.

## Building a labelled movie review corpus

Movie reviews were chosen because large online collections exist and reviewers often attach a machine-readable rating, such as a star count. Using those ratings meant the reviews did not need to be labelled by hand for training or evaluation.

Ratings were mapped to positive, negative or neutral, and only the positive and negative classes were used. Each author could contribute fewer than 20 reviews per sentiment category, which keeps a few prolific reviewers from dominating the corpus. The resulting corpus holds 752 negative and 1301 positive reviews from 144 reviewers.

The experiments use a uniform-class set of 700 positive and 700 negative documents, drawn at random from the corpus. The authors argue that the methods are not specific to movies and should transfer to other domains given enough training data, but the paper runs its experiments only on movie reviews.

## From review text to feature counts

Each review is handled in a bag-of-features framework over a predefined set of m features. Each review d becomes a count vector \\(\\vec{d} := (n\_1(d), \\ldots, n\_m(d))\\), where \\(n\_i(d)\\) is the number of times feature \\(f\_i\\) occurs in d.

Before counting, rating indicators are removed and the text is extracted from HTML, with punctuation kept as separate tokens. No stemming or stoplists are applied. Negation tagging attaches a NOT tag to each word between a negation word, such as not or didn't, and the next punctuation mark, so that good and not very good receive opposite tags.

Removing the negation tag made a negligible but slightly harmful difference.

The main feature sets are unigrams with negation tags, limited to the 16165 unigrams that appear at least four times in the 1400-document corpus. The second set is the 16165 most frequent bigrams, each occurring at least seven times, and these receive no negation tags. Maximum Entropy uses binary feature/class functions in any case, and counting frequencies would need a separate function for each count, which the authors judged impractical.

Two further schemes were tried: Qtag part-of-speech tags appended to each word, and a tag that marks whether a word falls in the first quarter, last quarter or middle half of a review. Adjective-only features and the 2633 most frequent unigrams were also tested.

## How the three classifiers score a review

Naive Bayes picks the class with the largest posterior probability, and Bayes' rule shows that the evidence term P(d) plays no role in that choice. It factorizes the likelihood by assuming the features are conditionally independent given the class, which gives \\(P\_{NB}(c \\mid d) := P(c)\\,\\prod\_{i=1}^{m} P(f\_i \\mid c)^{n\_i(d)} / P(d)\\). The probabilities P(c) and P(f\_i \| c) are estimated from relative frequencies with add-one smoothing.

Prior work by Domingos and Pazzani is cited as showing that this classifier can be optimal for some problems whose features depend heavily on one another.

Maximum Entropy models P(c \| d) as an exponential function of weighted feature/class indicators, divided by a normalization term Z(d). The model is \\(P\_{ME}(c \\mid d) := \\frac{1}{Z(d)} \\exp\\left(\\sum\_i \\lambda\_{i,c} F\_{i,c}(d,c)\\right)\\), and each indicator \\(F\_{i,c}(d,c')\\) equals 1 when \\(n\_i(d) \> 0\\) and \\(c' = c\\), and 0 otherwise. The weights \\(\\lambda\_{i,c}\\) are set to maximize entropy while matching the expected values of the feature/class functions on the training data, so a large weight marks a strong indicator for that class.

Training runs ten iterations of improved iterative scaling, with a Gaussian prior added to limit overfitting.

Support vector machines are large-margin rather than probabilistic classifiers: they seek the separating hyperplane with the widest margin. The hyperplane takes the form \\(\\vec{w} = \\sum\_j \\alpha\_j c\_j \\vec{d}\_j\\), with \\(\\alpha\_j \\ge 0\\) and \\(c\_j\\) equal to 1 or -1, and only the documents with \\(\\alpha\_j \> 0\\) are support vectors that contribute to \\(\\vec{w}\\).

Training used SVM light with default parameters, after length-normalizing each document vector, which the authors describe as standard practice.

## Human-chosen word lists as a baseline

Two graduate students each chose indicator words for positive and negative reviews, and each list became a decision procedure that counts matching words. The data were uniformly distributed across the two classes, so a random choice scores 50%. The first list reached 58% accuracy and the second 64%.

Tie rates were high, at 75% for the first list and 39% for the second. A tie means the two sentiments were rated equally likely, and the tie-breaking rule was chosen to maximize baseline accuracy. Most ties came from documents with zero positive and zero negative word matches.

A third list of seven positive and seven negative words, punctuation included, was built from frequency counts over the whole corpus, test data included, plus introspection. That list reached 69% accuracy with a tie rate of 16%. Items such as the question mark and still would not have come from introspection alone, yet they make sense on inspection.

The authors conclude that corpus-based techniques are worth exploring, rather than relying on prior intuitions about indicator features. Because this third list was chosen after looking at the test data, the 69% figure is a demanding baseline rather than an independent one.

## Classifier accuracy and feature variants

With unigram presence features, Naive Bayes reached 81.0, Maximum Entropy 80.4 and support vector machines 82.9, with accuracies in percent under three-fold cross-validation. All three beat the 50% random-choice baseline and the human lists at 58% and 64%. The margin over the 69% corpus-informed list was not large for support vector machines.

Using raw frequencies instead gave 78.7 for Naive Bayes and 72.8 for support vector machines. Binarizing the vectors helped, and the gain was much larger for support vector machines.

In prior work, bag-of-unigram features reached accuracies of 90% and above for particular topic categories. Those topic results involve more than two classes and different data, so the authors take the comparison as suggestive evidence that sentiment is the harder problem.

Adding bigrams to unigrams left the scores near unigram presence, at 80.6, 80.8 and 82.7. Bigrams alone fell to 77.3, 77.4 and 77.1, a drop of as much as 5.8 percentage points from unigram presence. The authors conclude that bigrams do not capture the context they expected in this setting.

Adding POS tags raised Naive Bayes slightly to 81.5 and lowered support vector machines to 81.9, while Maximum Entropy stayed at 80.4. Adjective-only features were the weakest set, at 77.0, 77.7 and 75.1. The 2633 most frequent unigrams gave 80.3, 81.0 and 81.4, comparable to the full unigram set. Position tags gave 81.0, 80.1 and 81.6, not far from unigrams alone.

## Why bag-of-features classifiers miss some reviews

Many reviews set up an expectation and then contrast it with a negative verdict, a pattern the authors call thwarted expectations. One example praises the cast and plot of a film and then says it cannot hold up, while another lists complaints about a movie and then says the reviewer loved it. The examples come from the full 2053-document corpus.

A human reads the true sentiment easily in such reviews, but bag-of-features classifiers would presumably find them hard, since many words point to the opposite sentiment. The authors expect this to be harder for classifiers that count words, and they do not test it directly.

Turney makes a similar observation for reviews, that the whole is not just the sum of the parts. The authors identify detecting whether sentences are on-topic as a co-reference problem and leave it to future work.

## Limitations

The 69% baseline was chosen after inspecting test data, so it is a demanding comparison point rather than an independent one. The examination was cursory, and the list is not claimed to be optimal.

All experiments use movie reviews, with a balanced 700 and 700 split, and studying skewed class distributions was out of scope. The topic-based comparison was not run on this corpus, because the only obvious topic is the film being reviewed and the maximum is 27 reviews per movie.

Cross-validation uses three folds rather than more, because MaxEnt training is slow. Feature selection was limited to frequency cutoffs and adjectives, and the authors suggest that explicit feature selection on unigrams could improve results. Positional and POS tags are rough approximations, and the authors note that finer notions of position might work better.

## Paper info

- **Authors**: Bo Pang, Lillian Lee, Shivakumar Vaithyanathan
- **Venue**: arXiv · Preprint
- **First published**: 2002-5-28
- **Added**: 2026-11-12
- **Updated**: 2002-5-28
- **Version**: v1
- **arXiv**: cs/0205070
- **Category**: cs.CL · cs.LG
- **Original paper terms**: [Check in the original ↗](https://arxiv.org/abs/cs/0205070v1)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/cs/0205070v1) · [PDF ↗](https://arxiv.org/pdf/cs/0205070v1)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Bo Pang, Lillian Lee, Shivakumar Vaithyanathan (2002). Thumbs up? Sentiment Classification using Machine Learning Techniques. arXiv:cs/0205070v1. https://arxiv.org/abs/cs/0205070v1

**BibTeX**

```
@misc{pang2002thumbs,
  title = {{Thumbs up? Sentiment Classification using Machine Learning Techniques}},
  author = {Bo Pang and Lillian Lee and Shivakumar Vaithyanathan},
  year = {2002},
  eprint = {cs/0205070},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/cs/0205070v1}
}
```

## Related papers

- [Estimating Continuous Distributions in Bayesian Classifiers](https://refivu.com/en/papers/318decb8-43d0-4596-b25f-944ca636af13-estimating-continuous-distributions-in-bayesian-classifiers.md)
- [A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks](https://refivu.com/en/papers/22cf25fe-084f-44ca-aecf-bc06457c3a2c-a-baseline-for-detecting-misclassified-and-out-of.md)
- [Deep Learning Based Text Classification: A Comprehensive Review](https://refivu.com/en/papers/f32bf8ee-1bca-48a8-92cd-28ac97a169bd-deep-learning-based-text-classification-a-comprehensive.md)
- [Universal Language Model Fine-tuning for Text Classification](https://refivu.com/en/papers/f2470a4a-1c9b-423c-8757-ba73cfe37b54-universal-language-model-fine-tuning-for-text-classification.md)
- [Can VLMs Diagnose and Recover from VLA Manipulation Faults?](https://refivu.com/en/papers/121caf8a-c8eb-4636-a58d-15ea45e3872a-can-vlms-diagnose-and-recover-from-vla-manipulation.md)
- [Evaluating Object Hallucination in Large Vision-Language Models](https://refivu.com/en/papers/994f787c-7b50-4945-8065-0d6a2ea146e6-evaluating-object-hallucination-in-large-vision-language.md)

## Other paper commentary

- [From Local to Global: A Graph RAG Approach to Query-Focused Summarization](https://refivu.com/en/papers/b90240e0-a6fe-4297-adb6-4ebd769e9c60-from-local-to-global-a-graph-rag-approach.md)
- [Abstractive Text Summarization Using Sequence-to-Sequence RNNs and Beyond](https://refivu.com/en/papers/7a55aaf9-654e-4a97-8efc-d0b4a9fccb7a-abstractive-text-summarization-using-sequence-to-sequence.md)
- [Teaching Machines to Read and Comprehend](https://refivu.com/en/papers/c971169f-9440-4e65-a62d-d8affa24f16a-teaching-machines-to-read-and-comprehend.md)
- [End-to-end Sequence Labeling via Bi-directional LSTM-CNNs-CRF](https://refivu.com/en/papers/ce633cbf-8295-40aa-a4ee-656b431af25f-end-to-end-sequence-labeling-via-bi-directional.md)
- [Crowdsourcing a Word-Emotion Association Lexicon](https://refivu.com/en/papers/3b0b67cb-6dd6-4162-9110-cdbb5d2cea2a-crowdsourcing-a-word-emotion-association-lexicon.md)
- [A Neural Attention Model for Abstractive Sentence Summarization](https://refivu.com/en/papers/d68d7c9a-7c6e-4b4f-a4e9-ba1853fdfad2-a-neural-attention-model-for-abstractive-sentence.md)
- [Run, Don't Walk: Chasing Higher FLOPS for Faster Neural Networks](https://refivu.com/en/papers/dffa1011-36cd-44c9-b21a-c10cc00af851-run-don-t-walk-chasing-higher-flops-for.md)
- [An All-in-One Network for Dehazing and Beyond](https://refivu.com/en/papers/03c50633-ad40-4af4-b88a-e6cb99e97639-an-all-in-one-network-for-dehazing-and.md)
- [SmoothGrad: removing noise by adding noise](https://refivu.com/en/papers/ab609ae7-27e3-4473-bc00-e8bc5f0e8a91-smoothgrad-removing-noise-by-adding-noise.md)
- [Fine-Grained Visual Classification of Aircraft](https://refivu.com/en/papers/3543af61-7a52-4fb1-ac78-312fdda48697-fine-grained-visual-classification-of-aircraft.md)
- [Vision Transformers for Dense Prediction](https://refivu.com/en/papers/9b71a7ee-e2ab-43e8-a6e8-d9dd244b9be7-vision-transformers-for-dense-prediction.md)
- [All-Optical Machine Learning Using Diffractive Deep Neural Networks](https://refivu.com/en/papers/818615cb-8c22-447c-a0a6-77954575b98a-all-optical-machine-learning-using-diffractive-deep-neural.md)

## Terms in this paper

- [support vector machines](https://refivu.com/en/terms/e3fc6dee1b39-support-vector-machines)
- [text categorization](https://refivu.com/en/terms/271d6c1bf193-text-categorization)
- [NAIVE BAYES](https://refivu.com/en/terms/a92b9ba76cdf-naive-bayes)
- [bigrams](https://refivu.com/en/terms/88404b1477c0-bigrams)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/099cc783-1d4a-4899-b08c-ce3886810f1a-thumbs-up-sentiment-classification-using-machine-learning)
