Loading…
Loading…
This model is a fine-tuned version of distilbert/distilbert-base-uncased for binary sentiment classification of English movie reviews.
It predicts whether a movie review expresses a positive or negative sentiment.
0: NEGATIVE1: POSITIVEThis model is intended for:
It is not specifically designed for sarcasm detection, emotion classification, or sentiment analysis in domains other than movie reviews.
The model was fine-tuned using the IMDb dataset, which contains movie reviews labeled as positive or negative.
The original training split was divided into:
The validation set was used for model evaluation and model selection during training.
The model was fine-tuned using the Hugging Face Trainer API.
| Hyperparameter | Value |
|---|---|
| Base model | distilbert/distilbert-base-uncased |
| Learning rate | 2e-5 |
| Training epochs | 3 |
| Training batch size | 16 |
| Weight decay | 0.01 |
| Maximum sequence length | 256 |
| Evaluation strategy | Per epoch |
| Model selection metric | F1-score |
| Optimizer | Trainer default |
The model was evaluated on the IMDb test split using the following metrics:
| Metric | Score |
|---|---|
| Accuracy | 0.91176 |
| Precision | 0.9099235425294679 |
| Recall | 0.914 |
| F1-score | 0.9119572158365262 |
You can load the model directly using the Transformers pipeline.
from transformers import pipeline
model_id = "YOUR_USERNAME/distilbert-imdb-sentiment"
classifier = pipeline(
"text-classification",
model=model_id
)
text = "The movie was fantastic. The acting and story were amazing!"
result = classifier(text)
print(result)
Example output:
[{'label': 'POSITIVE', 'score': 0.99}]
The score is the model's confidence for its predicted label. This example is illustrative, not a measured result.
Arjo Ghosh
This project was created as a practical exercise in fine-tuning and deploying transformer-based models using Hugging Face.
distilbert/distilbert-base-uncased