DistilBERT fine-tuned for movie review sentiment (IMDB)

Binary sentiment classifier (0 = negative, 1 = positive) built during the Wheeltrix Data Science & Analytics internship, as one half of a comparison with a TF-IDF + logistic regression baseline.

Training

distilbert-base-uncased fine-tuned on the 25,000 IMDB training reviews for 2 epochs (learning rate 2e-5, batch size 16, max length 256). Single run, no hyperparameter search.

Results

  • IMDB test set: 91.3% accuracy, F1 0.914 (91.2% when re-evaluated after training)
  • Zero-shot on other movie-review data: 80.7% on Rotten Tomatoes (test), 86.2% on SST-2 (validation)

Limitations

  • Trained only on movie reviews. It will be less reliable on other kinds of text.
  • Reviews are cut off at 256 tokens, so the model can miss a verdict stated at the end of a long review.
  • Struggles with sarcasm and some negation ("not bad"), and is sometimes confidently wrong: 47 of 100 sampled mistakes had at least 95% confidence.
  • A portfolio project, not a production system.

Usage

from transformers import pipeline
clf = pipeline("text-classification", model="sidratahseen/distilbert-imdb-sentiment")
clf("A heartfelt story with superb performances.")# LABEL_1 = positive, LABEL_0 = negative
Downloads last month
29
Safetensors
Model size
67M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for sidratahseen/distilbert-imdb-sentiment

Finetuned
(12756)
this model

Dataset used to train sidratahseen/distilbert-imdb-sentiment