BERT Emotion Classifier (Fine-tuned)

Fine-tuned bert-base-uncased for 6-class emotion classification on the dair-ai/emotion dataset.

Model Description

  • Author: Neeraj Gupta (@neeraj)
  • Task: Text Classification (Emotion Detection)
  • Base model: bert-base-uncased
  • Classes: sadness, joy, love, anger, fear, surprise
  • Framework: PyTorch + Hugging Face Transformers

Performance

Metric Score
Accuracy 91.75%
Weighted F1 91.64%

Evaluated on the validation split after training.

Usage

from transformers import pipeline

classifier = pipeline(
    "text-classification",
    model="neeraj-miniOrange/bert-emotion-finetuned"
)

result = classifier("I am so happy today!")
print(result)
# [{'label': 'joy', 'score': 0.98...}]

Training Details

Hyperparameter Value
Epochs 2
Learning rate 2e-4
Batch size 64
Weight decay 0.01
Optimizer AdamW

Data split: 70% train / 20% test / 10% validation (stratified)

Limitations

  • Trained on short English tweets; may not generalize well to long-form text or other languages.
  • Emotion labels are subjective; the model reflects biases present in the training data.
  • Not intended for clinical or mental health diagnosis.

Links

Citation

If you use this model, please cite the BERT paper:

@article{devlin2019bert,
  title={BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding},
  author={Devlin, Jacob and Chang, Ming-Wei and Lee, Kenton and Toutanova, Kristina},
  journal={NAACL},
  year={2019}
}
Downloads last month
-
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for neeraj-mO/bert-emotion-finetuned

Finetuned
(6869)
this model

Dataset used to train neeraj-mO/bert-emotion-finetuned