🎭 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)
Downloads last month
39
Safetensors
Model size
67M params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train lucky377/emotion_classifier