How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-classification", model="jupadev/new-model-test")
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("jupadev/new-model-test")
model = AutoModelForSequenceClassification.from_pretrained("jupadev/new-model-test", device_map="auto")
Quick Links

DistilBERT fine-tuned on IMDB (sentiment analysis)

Binary sentiment classifier for English movie reviews. It is distilbert-base-uncased fine-tuned on the IMDB dataset, and labels each review as POSITIVE or NEGATIVE.

Results

Evaluated once on the full IMDB test split (25,000 reviews, balanced 50/50). The checkpoint was selected on a separate validation set, never on test.

Metric Value
Accuracy 0.9111
F1 0.9121
Precision 0.9017
Recall 0.9228
Loss 0.3414

The model predicts POSITIVE for 51.2% of test reviews (true rate: 50%), a slight positive bias that shows up as recall being a bit higher than precision.

Usage

from transformers import pipeline

clf = pipeline("text-classification", model="jupadev/new-model-test")
clf("This movie was absolutely amazing, I loved every minute of it.")
# [{'label': 'POSITIVE', 'score': 0.99...}]

Label mapping: 0 โ†’ NEGATIVE, 1 โ†’ POSITIVE.

Training data

  • Source: stanfordnlp/imdb, train split (25,000 reviews).
  • The split is stored sorted by label (all negatives first), so it was shuffled (seed=42) before any subsetting.
  • Train / validation: 90% / 10% stratified split of the train set (~22,500 / ~2,500 reviews).
  • Test: the official test split (25,000 reviews), used only for the final evaluation.

Training procedure

Hyperparameter Value
Base model distilbert-base-uncased
Max sequence length 256 tokens (longer reviews truncated)
Learning rate 2e-5
LR scheduler linear, 10% warmup
Weight decay 0.01
Train batch size 16
Epochs up to 3, early stopping (patience 1)
Best model selection highest validation F1
Precision fp16 mixed precision
Padding dynamic (DataCollatorWithPadding)
Seed 42
Hardware 1ร— NVIDIA T4 (Google Colab)

Trained with the Hugging Face Trainer API.

Limitations

  • English only. Performance on other languages will be poor.
  • Domain: trained on movie reviews; expect lower accuracy on product reviews, social media, support tickets or other domains.
  • Truncation: only the first 256 tokens are used. Long reviews whose verdict comes at the end can be misclassified.
  • Binary output: there is no neutral class; mixed or ambivalent reviews are forced into positive or negative.
  • Sarcasm and irony remain common failure cases.
  • Scores are model probabilities, not calibrated confidence. On errors the model is often confidently wrong.
  • May reflect biases present in IMDB reviews and in DistilBERT's pretraining data.
Downloads last month
50
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 jupadev/new-model-test

Finetuned
(12,923)
this model

Dataset used to train jupadev/new-model-test

Evaluation results