Saana2005/distilbert-imdb-sentiment-classifier
DistilBERT IMDb Sentiment Classifier
This model is a fine-tuned version of `distilbert-base-uncased` for binary sentiment classification of English IMDb movie reviews. It predicts either NEGATIVE or POSITIVE.
The uploaded checkpoint is the seed-42 model, selected because it achieved the highest validation accuracy among three independently trained seeds.
Model details
Intended use
The model is intended for educational experiments and binary sentiment classification of English movie reviews. It can be used through the Transformers pipeline:
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Saana2005/distilbert-imdb-sentiment-classifier",
)
result = classifier(
"The movie was emotional, engaging, and beautifully acted.",
truncation=True,
max_length=256,
)
print(result)Training data
The model was trained with the `stanfordnlp/imdb` dataset.
The official 25,000-example training split was divided with fixed split seed 2026. The official test split was kept separate from model training and checkpoint selection.
Training procedure
Evaluation
The uploaded seed-42 checkpoint produced:
Three runs with seeds 7, 42, and 123 achieved mean test accuracy of 91.16% ± 0.02% and mean test F1 of 91.21% ± 0.07% (sample standard deviation).
Limitations
- The model handles only two sentiment classes and cannot represent neutral or mixed sentiment directly.
- It was trained on English movie reviews and is not a general-purpose emotion or opinion classifier.
- Inputs longer than 256 tokens are truncated, so important conclusions near the end of a long review may be omitted.
- Sarcasm, conflicting opinions, plot-heavy language, and annotation noise can cause errors.
- Confidence scores are model probability estimates, not guarantees that a prediction is correct.
- The model may inherit biases present in its pretrained model and IMDb data.
Source code
Training, evaluation, error-analysis, Slurm, command-line inference, and Gradio code are available in the `Sana1025/distilbert-imdb-sentiment-classifier` GitHub repository.
