language: en
license: apache-2.0
tags:
- sentiment-analysis
- text-classification
- distilbert
datasets:
- imdb
metrics:
- accuracy
- f1
pipeline_tag: text-classification
widget:
- text: "I absolutely loved this movie, it was amazing!"
- text: "This was the worst experience ever."
my-sentiment-analyzer
Fine-tuned DistilBERT model for sentiment analysis (positive / negative).
Training Data
IMDB dataset (25,000 train / 25,000 test)
Model Details
- Base model: distilbert-base-uncased
- Epochs: 2
- Learning rate: 2e-5
- Max length: 128
Evaluation Results
| Metric | Score |
|---|
| Accuracy | 0.874 |
| Precision | 0.864 |
| Recall | 0.888 |
| F1 | 0.875 |
Limitations
- English only
- Binary classification only
- Movie-review domain only
Usage
from transformers import pipeline
classifier = pipeline(
"sentiment-analysis",
model="kashafEjaz50/my-sentiment-analyzer"
)
print(classifier("This movie was fantastic!"))