dair-ai/emotion
Viewer • Updated • 437k • 28.3k • 449
How to use Pragyansh14/distilbert-emotion-classifier with PEFT:
Task type is invalid.
DistilBERT fine-tuned on 6-class emotion detection using LoRA (Low-Rank Adaptation). Trained on English tweets, classifies text into: sadness, joy, love, anger, fear, or surprise.
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="Pragyansh14/distilbert-emotion-classifier"
)
classifier("I can't believe this actually worked!")
# [{'label': 'surprise', 'score': 0.84}]
| Emotion | F1 | Support |
|---|---|---|
| joy | 0.92 | 704 |
| sadness | 0.90 | 550 |
| anger | 0.85 | 275 |
| fear | 0.80 | 212 |
| love | 0.80 | 178 |
| surprise | 0.73 | 81 |
Accuracy: 87.3% | Weighted F1: 0.87 | Macro F1: 0.83
The training dataset is significantly imbalanced — joy (33.5%) and sadness (29.2%) dominate while surprise is only 3.6%. As a result:
Base model
distilbert/distilbert-base-uncased