distilbert-base-uncased-finetuned-emotion
This model is a fine-tuned version of distilbert-base-uncased on the dair-ai/emotion dataset, classifying text into 6 emotions: sadness, joy, love, anger, fear, and surprise.
It achieves the following results on the evaluation set:
- Loss: 0.2168
- Accuracy: 0.927
- F1: 0.9269
Model description
DistilBERT fine-tuned for single-label emotion classification. Given a short piece of text, it predicts which of 6 emotions it most likely expresses, with a confidence score for each class.
Intended uses & limitations
Best suited for short, first-person statements that directly express a feeling (e.g. "I feel amazed by how the universe works," "I'm really proud of this project") — matching the style of its training data.
Known limitation: the model is less reliable on indirect or evaluative text, such as YouTube/product/video comments, which more often comment on content ("great video but the pacing felt rushed") rather than state an emotion directly. In informal testing on YouTube-style comments, the model sometimes produced confidently incorrect predictions on this kind of input. A natural next step would be fine-tuning on a labeled sample of comment-style data to close this domain gap.
Training and evaluation data
Trained on the dair-ai/emotion dataset (16,000 train / 2,000 validation / 2,000 test examples), a collection of short English tweets labeled with one of 6 emotions.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 64
- eval_batch_size: 64
- seed: 42
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- num_epochs: 2
Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 |
|---|---|---|---|---|---|
| 0.8017 | 1.0 | 250 | 0.3070 | 0.9065 | 0.9048 |
| 0.2457 | 2.0 | 500 | 0.2168 | 0.927 | 0.9269 |
Framework versions
- Transformers 5.12.1
- Pytorch 2.11.0+cu128
- Datasets 4.0.0
- Tokenizers 0.22.2