stanfordnlp/imdb
Viewer โข Updated โข 100k โข 160k โข 963
How to use jupadev/new-model-test with Transformers:
# 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")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.
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.
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.
stanfordnlp/imdb, train split (25,000 reviews).seed=42) before any subsetting.test split (25,000 reviews), used only for the final
evaluation.| 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.
Base model
distilbert/distilbert-base-uncased