Loading…
Loading…
This model is a fine-tuned version of distilbert/distilbert-base-uncased for binary sentiment classification of English movie reviews.
It was developed as an independent Hugging Face learning project, covering dataset preparation, tokenization, fine-tuning, checkpoint selection, evaluation, and model publishing.
The model predicts two sentiment labels:
NEGATIVE (0)POSITIVE (1)Dataset: IMDb Movie Reviews
The training and validation samples were drawn from the official IMDb training split.
| Split | Samples |
|---|---|
| Training | 5,000 |
| Validation | 1,000 |
| Independent test subset | 200 |
The training and validation datasets were balanced across positive and negative classes.
The test subset was sampled from the official IMDb test split, with 100 examples per class.
| Parameter | Value |
|---|---|
| Base model | DistilBERT Base Uncased |
| Epochs | 3 |
| Training batch size | 16 |
| Evaluation batch size | 16 |
| Learning rate | 2e-5 |
| Weight decay | 0.01 |
| Maximum sequence length | 128 |
| Learning rate scheduler | Linear |
| Warmup steps | 94 |
| Random seed | 42 |
| Model selection metric | Validation Macro F1 |
| Best checkpoint | Step 939 |
| Training device | CPU |
The model was trained using Hugging Face Transformers and PyTorch.
| Metric | Value |
|---|---|
| Accuracy | 0.8500 |
| Macro F1 | 0.84998 |
| Loss | 0.42117 |
| Metric | Value |
|---|---|
| Accuracy | 0.86 |
| Macro F1 | 0.86 |
| Negative Recall | 0.84 |
| Positive Recall | 0.88 |
Confusion matrix:
[[84, 16],
[12, 88]]
These results are based on a small, balanced subset of the official IMDb test split. They should not be interpreted as performance on the complete IMDb benchmark.
The same test subset was also used for comparison with earlier experimental versions, so these results are exploratory rather than a fully untouched final benchmark.
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="YOUR_USERNAME/distilbert-imdb-sentiment-v3"
)
result = classifier(
"This movie was absolutely fantastic!"
)
print(result)
Replace YOUR_USERNAME with the actual Hugging Face account name after publishing.
Apache-2.0, following the base model's license.
This is an independent Hugging Face learning project and does not depend on an external GitHub repository.
distilbert/distilbert-base-uncased