# IMDB Large Movie Review (2011)

> 50,000 movie reviews from IMDb, labeled positive or negative.

Page: https://mralbu.github.io/ai-datasets/d/imdb

## Key facts

- Category: Text
- Task: Binary sentiment classification
- Creators: Andrew L. Maas et al. (Stanford)
- Size: 50,000 labeled reviews + 50,000 unlabeled
- Splits: train 25,000, test 25,000, unsupervised 50,000
- Input: Free-form English review text (often several paragraphs)
- Labels: neg (rating ≤ 4/10) or pos (rating ≥ 7/10)
- License: Research use (no formal license)
- Paper: [Learning Word Vectors for Sentiment Analysis](https://aclanthology.org/P11-1015/)
- Homepage: https://ai.stanford.edu/~amaas/data/sentiment/
- Hugging Face: [stanfordnlp/imdb](https://huggingface.co/datasets/stanfordnlp/imdb)
- Sampled at Hub revision e6281661ce1c48d982bc483cf8a173c1bbeb5d31 (2026-11-07)

## Why it matters

The default "first text classifier" dataset, used in Keras, fastai and PyTorch tutorials. It is big enough that bag-of-words baselines are respectable but long-range context helps, so it charted the move from n-grams to RNNs, ULMFiT and fine-tuned transformers.

## Worth knowing

- Neutral reviews (5–6/10) were left out of the labeled train and test sets (the unlabeled set keeps them), so the task is easier than real-world sentiment.
- At most 30 reviews per movie, and train and test use disjoint movies, so a model can't just memorize titles.
- Both splits are exactly balanced (12,500 pos / 12,500 neg) and the files are sorted by label. Shuffle before you slice.
- Reviews contain leftover HTML like <br /><br />.

## Get the data

```bash
# pip install -U huggingface_hub
hf download stanfordnlp/imdb --repo-type dataset \
  --local-dir imdb
```

```python
from datasets import load_dataset   # pip install datasets

ds = load_dataset("stanfordnlp/imdb", "plain_text")
print(ds)
```

```python
import polars as pl

df = pl.read_parquet("hf://datasets/stanfordnlp/imdb@~parquet/plain_text/test/*.parquet")
print(df.shape)
```

## Related datasets

- [20 Newsgroups](https://huggingface.co/datasets/SetFit/20_newsgroups): 1995, topic instead of sentiment (on this site: https://mralbu.github.io/ai-datasets/d/20-newsgroups)
- [SST / SST-2](https://huggingface.co/datasets/stanfordnlp/sst2): 2013, sentence-level sentiment, part of GLUE (on this site: https://mralbu.github.io/ai-datasets/d/glue)

## Landmark papers

- [Universal Language Model Fine-tuning for Text Classification (ULMFiT)](https://arxiv.org/abs/1801.06146) (2018)

## Papers on this site that use it

- [Adam (2014)](https://mralbu.github.io/ai-datasets/p/adam.md): The optimizer that trains most neural networks, with defaults that work without tuning.
- [DPO (2023)](https://mralbu.github.io/ai-datasets/p/dpo.md): RLHF without the reinforcement learning, as one simple loss on pairs of preferred and rejected answers.
