Downloads · 30 days
41
5% of all-time downloads
alex-shvets/roberta-large-emopillars-contextless-goemotions
roberta-large-emopillars-contextless-goemotions is a text classification model from alex-shvets. Use it when you need a label for a piece of text. It is set up for transformers.
This model is a fine-tuned version of roberta-large-emopillars-contextless on the GoEmotions dataset. The base model was trained on EmoPillars' context-less subset.
Downloads · 30 days
41
5% of all-time downloads
All-time downloads
899
Public
Parameters
355M
1.4 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of roberta-large-emopillars-contextless on the GoEmotions dataset. The base model was trained on EmoPillars' context-less subset.
<img src="https://huggingface.co/datasets/alex-shvets/images/resolve/main/emopillars_color_2.png" width="450">The model is a multi-label classifier over 28 emotional classes for a context-less scenario. It detects emotions in the entire input (including context if provided).
Here is how to use this model:
>>> import torch
>>> from transformers import pipeline
>>> model_name = "roberta-large-emopillars-contextless-goemotions"
>>> threshold = 0.36
>>> emotions = [
>>> "admiration", "amusement", "anger", "annoyance", "approval", "caring", "confusion",
>>> "curiosity", "desire", "disappointment", "disapproval", "disgust", "embarrassment",
>>> "excitement", "fear", "gratitude", "grief", "joy", "love", "nervousness", "optimism",
>>> "pride", "realization", "relief", "remorse", "sadness", "surprise", "neutral"
>>> ]
>>> label_to_emotion = dict(zip(list(range(len(emotions))), emotions))
>>> device = torch.device("cuda" if torch.cuda.is_available() else "CPU")
>>> pipe = pipeline("text-classification", model=model_name, truncation=True,
>>> return_all_scores=True, device=-1 if device.type=="cpu" else 0)
>>> # input in a format f"{text}"
>>> utterances = [
>>> "Ok is it just me or is anyone else getting goosebumps too???",
>>> "Don’t know what to do",
>>> "I’m glad you had a great time here! Wishing you safe travels!"
>>> ]
>>> outcome = pipe(utterances)
>>> dominant_classes = [
>>> [prediction for prediction in example if prediction['score'] >= threshold]
>>> for example in outcome
>>> ]
>>> for example in dominant_classes:
>>> print(", ".join([
>>> "%s: %.2lf" % (label_to_emotion[int(prediction['label'])], prediction['score'])
>>> for prediction in sorted(example, key=lambda x: x['score'], reverse=True)
>>> ]))
curiosity: 0.88
confusion: 1.00
caring: 0.89, joy: 0.39
The training data consists of 43,410 samples of the GoEmotions dataset.
The following hyperparameters were used during training:
Scores for the evaluation on the GoEmotions test split:
| class | precision | recall | f1-score | GoEmotions f1-score | Gain |
|---|---|---|---|---|---|
| admiration | 0.64 | 0.80 | 0.71 | 0.65 | 0.06 |
| amusement | 0.75 | 0.93 | 0.83 | 0.8 | 0.03 |
| anger | 0.51 | 0.56 | 0.53 | 0.47 | 0.06 |
| annoyance | 0.36 | 0.40 | 0.38 | 0.34 | 0.04 |
| approval | 0.40 | 0.44 | 0.42 | 0.36 | 0.06 |
| caring | 0.44 | 0.45 | 0.44 | 0.39 | 0.05 |
| confusion | 0.41 | 0.53 | 0.46 | 0.37 | 0.09 |
| curiosity | 0.49 | 0.69 | 0.57 | 0.54 | 0.03 |
| desire | 0.58 | 0.48 | 0.53 | 0.49 | 0.04 |
| disappointment | 0.40 | 0.33 | 0.36 | 0.28 | 0.08 |
| disapproval | 0.43 | 0.48 | 0.46 | 0.39 | 0.07 |
| disgust | 0.47 | 0.49 | 0.48 | 0.45 | 0.03 |
| embarrassment | 0.55 | 0.46 | 0.50 | 0.43 | 0.07 |
| excitement | 0.44 | 0.50 | 0.47 | 0.34 | 0.13 |
| fear | 0.57 | 0.76 | 0.65 | 0.6 | 0.05 |
| gratitude | 0.91 | 0.91 | 0.91 | 0.86 | 0.05 |
| grief | 0.5 | 0.67 | 0.57 | 0 | 0.57 |
| joy | 0.59 | 0.69 | 0.64 | 0.51 | 0.13 |
| love | 0.74 | 0.92 | 0.82 | 0.78 | 0.04 |
| nervousness | 0.44 | 0.48 | 0.46 | 0.35 | 0.11 |
| neutral | 0.57 | 0.59 | 0.58 | 0.68 | -0.10 |
| optimism | 0.57 | 0.50 | 0.53 | 0.51 | 0.02 |
| pride | 0.32 | 0.25 | 0.28 | 0.36 | -0.08 |
| realization | 0.20 | 0.18 | 0.19 | 0.21 | -0.02 |
| relief | 0.56 | 0.82 | 0.67 | 0.15 | 0.52 |
| remorse | 0.54 | 0.62 | 0.58 | 0.66 | -0.08 |
| sadness | 0.54 | 0.60 | 0.57 | 0.49 | 0.08 |
| surprise | 0.68 | 0.67 | 0.68 | 0.5 | 0.18 |
| Micro average | 0.58 | 0.64 | 0.61 | - | - |
| Macro average | 0.53 | 0.58 | 0.55 | 0.46 | 0.09 |
| STD | 0.14 | 0.19 | 0.16 | 0.19 | 0.14 |
For more details on the evaluation, please visit our GitHub repository or paper.
If you use this model, please cite our paper:
@misc{shvets2025emopillarsknowledgedistillation,
title={Emo Pillars: Knowledge Distillation to Support Fine-Grained Context-Aware and Context-Less Emotion Classification},
author={Alexander Shvets},
year={2025},
eprint={2504.16856},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2504.16856}
}
The model published in this repository is intended for a generalist purpose and is available to third parties. This model may have bias and/or any other undesirable distortions.
When third parties deploy or provide systems and/or services to other parties using this model (or using systems based on this model) or become users of the model, they should note that it is their responsibility to mitigate the risks arising from its use and, in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.
In no event shall the creator of the model be liable for any results arising from the use made by third parties of this model.
</details>