IMDB Sentiment Classifier (DistilBERT)
A binary sentiment classifier fine-tuned on movie reviews. Returns POSITIVE or NEGATIVE with a confidence score.
Usage
from transformers import pipeline
classifier = pipeline("sentiment-analysis", model="OxImmanuel/imdb-sentiment-distilbert")
classifier("I didn't expect much, but it was excellent.")
Training
- Base model: distilbert/distilbert-base-uncased
- Dataset: IMDB, 5,000-example shuffled subset of the train split
- Epochs: 2
- Learning rate: 2e-5
- Batch size: 16
- Max sequence length: 256 tokens
Results
88% accuracy on a 1,000-example held-out test set.
Limitations
Trained on movie reviews, so accuracy drops on other kinds of text โ tweets, support tickets, product reviews all have different language patterns than what this saw.
Inputs are truncated at 256 tokens. Since reviewers often state their verdict at the end, longer reviews may lose the deciding signal.
Trained on a 5,000-example subset rather than the full 25,000, so this underperforms what the same setup would achieve with more data.
English only. Binary output only โ no neutral class.
- Downloads last month
- 3