dair-ai/emotion
Viewer • Updated • 437k • 33.7k • 441
How to use shivvamm/emotion-distilbert-finetuned with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="shivvamm/emotion-distilbert-finetuned") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("shivvamm/emotion-distilbert-finetuned")
model = AutoModelForSequenceClassification.from_pretrained("shivvamm/emotion-distilbert-finetuned")This is a DistilBERT-based model fine-tuned for emotion classification on the dair-ai/emotion dataset.
It predicts one of 6 emotion labels for a given text:
sadnessjoyloveangerfearsurprisedistilbert-base-uncaseddair-ai/emotionDataset: dair-ai/emotion
| Split | Samples |
|---|---|
| Train | 16,000 |
| Validation | 2,000 |
| Test | 2,000 |
| Total | 20,000 |
Classes (labels):
0 → sadness 1 → joy 2 → love 3 → anger 4 → fear 5 → surpriseYou can use the model directly with the 🤗 Transformers pipeline:
from transformers import pipeline
classifier = pipeline("text-classification", model="shivvamm/emotion-distilbert-finetuned", top_k=None)
text = "I feel hopeful and excited about the future."
results = classifier(text)
print(results)
[{'label': 'joy', 'score': 0.9876}]
@misc{shivvamm2025emotion,
title={Emotion Classification using DistilBERT},
author={Shivvamm},
year={2025},
howpublished={\url{https://huggingface.co/shivvamm/emotion-distilbert-finetuned}},
note={Fine-tuned on the dair-ai/emotion dataset}
}
Shivvamm
Model: shivvamm/emotion-distilbert-finetuned
License: MIT
💡 Fine-tuned with 🤗 Hugging Face Transformers and Accelerate