UltraBERT Go Emotions 2026-10
Overview
This model was fine-tuned from UltraBERT-150M on the GoEmotions dataset for multi-label classification. It predicts emotional states in text, with a total of 28 possible labels. Each input text can have one or more associated labels, reflecting the multi-label nature of the task.
Intended Use
The model is designed for emotion classification in English-language text, particularly in domains such as:
- Social media sentiment analysis
- Customer feedback evaluation
- Behavioral or psychological research
Example Usage
Here’s how to use the model with Hugging Face Transformers:
# requires transformers>=5.2: pip install -U "transformers>=5.2"
from transformers import pipeline
import torch
# Load the model
classifier = pipeline(
"text-classification",
model="cirimus/ultrabert-150M-go-emotions",
top_k=5,
trust_remote_code=True
)
text = "I am so happy and excited about this opportunity!"
predictions = classifier(text)
# Print top 5 detected emotions
print("\nTop 5 emotions detected:")
for pred in predictions[0]: # Note: predictions is [[...]] format
print(f"\t{pred['label']:10s} : {pred['score']:.3f}")
# Example output
# Top 5 emotions detected:
# excitement : 0.937
# joy : 0.640
# admiration : 0.021
# gratitude : 0.017
# approval : 0.015
Model Details
- Base Model: UltraBERT-150M
- Fine-Tuning Dataset: GoEmotions
- Number of Labels: 28
- Problem Type: Multi-label classification
- Language: English
- License: Apache 2.0
- Fine-Tuning Framework: Hugging Face Transformers
- Release: October 2026
- Version: 2026-10 (Optimized)
Training Improvements
| Parameter | Baseline | 2026-10 |
|---|---|---|
| Learning Rate | 2e-5 | 3e-5 |
| LR Schedule | Linear | Cosine + Warmup |
| Optimizer | AdamW | Adafactor |
| Weight Decay | 0.01 | 0.001 |
| Batch Size | 16 | 32 |
| New: EMA | None | 0.999 decay |
| New: Dropout Tuning | Default | Classifier: 0.1, Attention: 0.05 |
Overall Results (threshold 0.5)
| Split | Accuracy | Precision | Recall | Macro F1 | Micro F1 |
|---|---|---|---|---|---|
| Train | 0.978 | 0.798 | 0.526 | 0.603 | 0.702 |
| Validation | 0.971 | 0.650 | 0.429 | 0.495 | 0.602 |
| Test | 0.971 | 0.657 | 0.430 | 0.497 | 0.603 |
Dataset
The GoEmotions dataset is a multi-label emotion classification dataset derived from Reddit comments. It contains 58,000 examples with 28 emotion labels (e.g., admiration, amusement, anger, etc.), and it is annotated for multi-label classification.
Evaluation Results
The model was evaluated on the test split of the GoEmotions dataset, using a threshold of 0.5 for binarizing predictions. The overall metrics were:
Standard Results:
Using the default threshold of 0.5.
| Label | Accuracy | Precision | Recall | F1 | MCC | Support | Threshold |
|---|---|---|---|---|---|---|---|
| macro avg | 0.971 | 0.657 | 0.430 | 0.497 | 0.503 | 5427 | 0.5 |
| admiration | 0.948 | 0.723 | 0.714 | 0.719 | 0.690 | 504 | 0.5 |
| amusement | 0.982 | 0.792 | 0.864 | 0.826 | 0.818 | 264 | 0.5 |
| anger | 0.970 | 0.653 | 0.399 | 0.495 | 0.496 | 198 | 0.5 |
| annoyance | 0.944 | 0.587 | 0.191 | 0.288 | 0.313 | 320 | 0.5 |
| approval | 0.943 | 0.642 | 0.276 | 0.386 | 0.397 | 351 | 0.5 |
| caring | 0.976 | 0.549 | 0.289 | 0.379 | 0.388 | 135 | 0.5 |
| confusion | 0.975 | 0.605 | 0.340 | 0.435 | 0.442 | 153 | 0.5 |
| curiosity | 0.952 | 0.551 | 0.415 | 0.474 | 0.454 | 284 | 0.5 |
| desire | 0.989 | 0.750 | 0.398 | 0.520 | 0.541 | 83 | 0.5 |
| disappointment | 0.974 | 0.647 | 0.146 | 0.238 | 0.299 | 151 | 0.5 |
| disapproval | 0.953 | 0.544 | 0.303 | 0.389 | 0.384 | 267 | 0.5 |
| disgust | 0.982 | 0.705 | 0.350 | 0.467 | 0.489 | 123 | 0.5 |
| embarrassment | 0.995 | 0.722 | 0.351 | 0.473 | 0.502 | 37 | 0.5 |
| excitement | 0.982 | 0.556 | 0.340 | 0.422 | 0.426 | 103 | 0.5 |
| fear | 0.992 | 0.743 | 0.705 | 0.724 | 0.720 | 78 | 0.5 |
| gratitude | 0.991 | 0.958 | 0.901 | 0.928 | 0.924 | 352 | 0.5 |
| grief | 0.999 | 0.000 | 0.000 | 0.000 | 0.000 | 6 | 0.5 |
| joy | 0.979 | 0.677 | 0.534 | 0.597 | 0.591 | 161 | 0.5 |
| love | 0.982 | 0.782 | 0.815 | 0.798 | 0.789 | 238 | 0.5 |
| nervousness | 0.996 | 0.455 | 0.217 | 0.294 | 0.312 | 23 | 0.5 |
| optimism | 0.975 | 0.705 | 0.489 | 0.578 | 0.576 | 186 | 0.5 |
| pride | 0.998 | 0.857 | 0.375 | 0.522 | 0.566 | 16 | 0.5 |
| realization | 0.974 | 0.556 | 0.138 | 0.221 | 0.268 | 145 | 0.5 |
| relief | 0.998 | 1.000 | 0.182 | 0.308 | 0.426 | 11 | 0.5 |
| remorse | 0.992 | 0.588 | 0.714 | 0.645 | 0.644 | 56 | 0.5 |
| sadness | 0.979 | 0.687 | 0.506 | 0.583 | 0.580 | 156 | 0.5 |
| surprise | 0.979 | 0.644 | 0.461 | 0.537 | 0.535 | 141 | 0.5 |
| neutral | 0.792 | 0.710 | 0.621 | 0.662 | 0.515 | 1787 | 0.5 |
Optimal Results:
Using the best threshold for each label based on the training set (tuned on F1).
| Label | Accuracy | Precision | Recall | F1 | MCC | Support | Threshold |
|---|---|---|---|---|---|---|---|
| macro avg | 0.967 | 0.574 | 0.541 | 0.550 | 0.535 | 5427 | various |
| admiration | 0.946 | 0.699 | 0.734 | 0.716 | 0.687 | 504 | 0.44 |
| amusement | 0.983 | 0.817 | 0.830 | 0.823 | 0.814 | 264 | 0.60 |
| anger | 0.965 | 0.520 | 0.525 | 0.523 | 0.504 | 198 | 0.31 |
| annoyance | 0.917 | 0.344 | 0.441 | 0.386 | 0.346 | 320 | 0.24 |
| approval | 0.930 | 0.459 | 0.442 | 0.450 | 0.413 | 351 | 0.27 |
| caring | 0.971 | 0.408 | 0.378 | 0.392 | 0.378 | 135 | 0.32 |
| confusion | 0.967 | 0.436 | 0.536 | 0.481 | 0.467 | 153 | 0.26 |
| curiosity | 0.948 | 0.505 | 0.687 | 0.582 | 0.563 | 284 | 0.35 |
| desire | 0.988 | 0.655 | 0.458 | 0.539 | 0.542 | 83 | 0.34 |
| disappointment | 0.966 | 0.366 | 0.318 | 0.340 | 0.324 | 151 | 0.23 |
| disapproval | 0.946 | 0.449 | 0.461 | 0.455 | 0.426 | 267 | 0.32 |
| disgust | 0.978 | 0.533 | 0.390 | 0.451 | 0.446 | 123 | 0.32 |
| embarrassment | 0.994 | 0.630 | 0.459 | 0.531 | 0.535 | 37 | 0.21 |
| excitement | 0.978 | 0.438 | 0.476 | 0.456 | 0.445 | 103 | 0.25 |
| fear | 0.992 | 0.758 | 0.641 | 0.694 | 0.693 | 78 | 0.54 |
| gratitude | 0.991 | 0.960 | 0.892 | 0.925 | 0.921 | 352 | 0.53 |
| grief | 0.998 | 0.143 | 0.167 | 0.154 | 0.153 | 6 | 0.07 |
| joy | 0.979 | 0.653 | 0.609 | 0.630 | 0.620 | 161 | 0.40 |
| love | 0.983 | 0.783 | 0.849 | 0.815 | 0.806 | 238 | 0.45 |
| nervousness | 0.996 | 0.500 | 0.435 | 0.465 | 0.464 | 23 | 0.34 |
| optimism | 0.974 | 0.625 | 0.591 | 0.608 | 0.594 | 186 | 0.30 |
| pride | 0.998 | 0.875 | 0.438 | 0.583 | 0.618 | 16 | 0.24 |
| realization | 0.968 | 0.353 | 0.248 | 0.291 | 0.280 | 145 | 0.21 |
| relief | 0.999 | 0.750 | 0.545 | 0.632 | 0.639 | 11 | 0.17 |
| remorse | 0.992 | 0.575 | 0.821 | 0.676 | 0.683 | 56 | 0.44 |
| sadness | 0.976 | 0.591 | 0.564 | 0.577 | 0.565 | 156 | 0.40 |
| surprise | 0.978 | 0.582 | 0.504 | 0.540 | 0.530 | 141 | 0.42 |
| neutral | 0.786 | 0.668 | 0.697 | 0.682 | 0.521 | 1787 | 0.42 |
Confusion matrix:
Limitations and Biases
- Data Bias: The dataset is based on Reddit comments, which may not generalize well to other domains or cultural contexts.
- Underrepresented Classes: Certain labels like "grief" and "relief" have very few examples, leading to lower performance for those classes.
- Ambiguity: Some training data contain annotation inconsistencies or ambiguities that may impact predictions.
Environmental Impact
- Hardware Used: NVIDIA DGX Spark (GB10)
- Training Time: <1 hour
- Carbon Emissions: ~0.01 kg CO2 (calculated via ML CO2 Impact Calculator).
Citation
If you use this model, please cite it as follows:
@misc{junque2025emotion,
title = {Emotion and Bias Classification with Modern Encoders},
author = {Junqu\'e de Fortuny, Enric},
year = {2025},
howpublished = {\url{https://huggingface.co/spaces/cirimus/emotion-detection}}
}