dair-ai/emotion
Viewer โข Updated โข 437k โข 23.6k โข 449
How to use G25AIT2134/distilbert-emotion with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="G25AIT2134/distilbert-emotion") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("G25AIT2134/distilbert-emotion")
model = AutoModelForSequenceClassification.from_pretrained("G25AIT2134/distilbert-emotion", device_map="auto")Fine-tuned distilbert-base-uncased on the dair-ai/emotion
dataset to classify English text into six emotions: sadness, joy, love,
anger, fear, surprise.
This model was produced as part of an end-to-end MLOps pipeline project (data prep โ training with Weights & Biases tracking โ Hub publishing โ containerised inference โ CI/CD).
Single-label emotion classification of short English text (e.g. tweets, messages). Not intended for clinical, safety-critical, or high-stakes use.
split config โ 16k/2k/2k)| Metric | Score |
|---|---|
| Accuracy | 0.9335 |
| Weighted F1 | 0.9329 |
| Macro F1 | 0.8924 |
The gap between weighted and macro F1 reflects class imbalance in the dataset (joy and sadness dominate; love and surprise are rare).
from transformers import pipeline
clf = pipeline("text-classification", model="G25AIT2134/distilbert-emotion")
clf("I can't believe how happy this makes me!")
Base model
distilbert/distilbert-base-uncased