DistilBERT Fine-Tuned for Emotion Detection
Model Description
This model is a fine-tuned version of distilbert-base-uncased on the Emotion dataset for detecting emotions in English Twitter text.
The model classifies text into six basic emotions:
| Label | Emotion |
|---|---|
| 0 | sadness |
| 1 | joy |
| 2 | love |
| 3 | anger |
| 4 | fear |
| 5 | surprise |
Intended Use
- Detecting emotional states in short English text (tweets, messages, comments)
- Social media monitoring and sentiment analysis
- Customer feedback emotion classification
Training Details
| Parameter | Value |
|---|---|
| Base Model | distilbert-base-uncased |
| Dataset | emotion (16,000 train / 2,000 validation) |
| Epochs | 1 |
| Learning Rate | 1e-3 |
| Batch Size | 8 |
| Weight Decay | 0.01 |
Evaluation Results
- Accuracy: ~92%
- F1-Score (weighted): ~92%
Usage
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="<your-username>/distilbert-finetuned-emotion"
)
result = classifier("I am feeling great today!")
print(result)
# [{'label': 'joy', 'score': 0.98}]
Limitations
- Trained on Twitter data — may not generalize well to formal text
- Class imbalance:
joyandsadnessare overrepresented surpriseandloveare the most challenging categories- Only 1 epoch of fine-tuning — additional training may improve performance
License
Apache 2.0