🎭 Fine-Tuned DistilBERT Emotion Classifier
This repository hosts a fine-tuned DistilBERT model for text emotion classification, trained on the dair-ai/emotion dataset.
It categorizes English text into 6 distinct emotional classes:
sadness(0)joy(1)love(2)anger(3)fear(4)surprise(5)
📌 Model Summary
- Model Architecture: DistilBERT (
distilbert-base-uncased) - Task: Text Sequence Classification (Emotion & Sentiment Analysis)
- Dataset:
dair-ai/emotion(20,000 annotated text snippets) - Language: English (
en) - License: Apache 2.0
🏷️ Emotion Class Mapping
| Label ID | Emotion Tag | Description & Typical Mood Indicators |
|---|---|---|
0 | sadness | Feelings of sorrow, heartbreak, grief, disappointment, or loneliness |
1 | joy | Happiness, excitement, achievement, satisfaction, and delight |
2 | love | Warmth, affection, appreciation, gratitude, and romantic connection |
3 | anger | Frustration, annoyance, rage, irritation, and hostility |
4 | fear | Anxiety, apprehension, nervousness, panic, and terror |
5 | surprise | Astonishment, awe, unexpected news, and shock |
🚀 Quickstart Usage
1. Using Hugging Face transformers Pipeline
from transformers import pipeline
# Initialize the text classification pipeline
classifier = pipeline(
"text-classification",
model="lucky377/emotion_classifier",
return_all_scores=True
)
text = "I am so happy and excited about this new project!"
predictions = classifier(text)
print(predictions)