DistilBERT โ€” Emotion Classification

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).

Intended use

Single-label emotion classification of short English text (e.g. tweets, messages). Not intended for clinical, safety-critical, or high-stakes use.

Training

  • Base model: distilbert-base-uncased
  • Dataset: dair-ai/emotion (split config โ€” 16k/2k/2k)
  • Max sequence length: 64 (95th-percentile text length was 41 words)
  • Best hyperparameters: learning rate 5e-5, batch size 16, 3 epochs, weight decay 0.01
  • Tracking: Weights & Biases (loss, accuracy, weighted/macro F1, system metrics)

Evaluation (held-out test split)

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).

Usage

from transformers import pipeline
clf = pipeline("text-classification", model="G25AIT2134/distilbert-emotion")
clf("I can't believe how happy this makes me!")

Limitations

  • English only; informal/tweet-style text.
  • Lower accuracy on under-represented classes (love, surprise).
  • Inherits any biases present in the training data.
Downloads last month
6
Safetensors
Model size
67M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for G25AIT2134/distilbert-emotion

Finetuned
(12206)
this model

Dataset used to train G25AIT2134/distilbert-emotion

Evaluation results