This model was fine-tuned from
ModernBERT-base
on the
Super Emotion
dataset for multi-class emotion classification. It predicts emotional states in text across seven labels:
joy, sadness, anger, fear, love, neutral, surprise
.
Here’s how to use the model with Hugging Face Transformers:
from transformers import pipeline
# Load the model
classifier = pipeline(
"text-classification",
model="cirimus/modernbert-base-emotions",
top_k=5
)
text = "I can't believe this just happened!"
predictions = classifier(text)
# Print top 3 detected emotions
sorted_preds = sorted(predictions[0], key=lambda x: x['score'], reverse=True)
top_3 = sorted_preds[:3]
print("\nTop 3 emotions detected:")
for pred in top_3:
print(f"\t{pred['label']:10s} : {pred['score']:.3f}")
# Example output:# Top 3 emotions detected:# SURPRISE : 0.913# SADNESS : 0.033# NEUTRAL : 0.021
How the Model Was Created
The model was fine-tuned for 2 epochs using the following hyperparameters:
Learning Rate
:
2e-5
Batch Size
: 16
Weight Decay
:
0.01
Warmup Steps
: Cosine decay scheduling
Optimizer
: AdamW
Evaluation Metrics
: Precision, Recall, F1 Score (macro), Accuracy
Evaluation Results
As evaluated on the joint test-set:
Accuracy
Precision
Recall
F1
MCC
Support
macro avg
0.872
0.827
0.850
0.836
0.840
56310
NEUTRAL
0.965
0.711
0.842
0.771
0.755
3907
SURPRISE
0.976
0.693
0.772
0.730
0.719
2374
FEAR
0.975
0.897
0.841
0.868
0.855
5608
SADNESS
0.960
0.910
0.937
0.923
0.896
14547
JOY
0.941
0.933
0.872
0.902
0.861
17328
ANGER
0.964
0.912
0.818
0.862
0.843
7793
LOVE
0.962
0.734
0.867
0.795
0.778
4753
Intended Use
The model is designed for emotion classification in English-language text, particularly useful for:
Social media sentiment analysis
Customer feedback evaluation
Large scale behavioral or psychological research
The model is designed for fast and accurate emotion detection but struggles with subtle expressions or indirect references to emotions (e.g., "
I find myself remembering the little things you say, long after you've said them.
")
Limitations and Biases
Data Bias
: The dataset is aggregated from multiple sources and may contain biases in annotation and class distribution.
Underrepresented Classes
: Some emotions have fewer samples, affecting their classification performance.
Context Dependence
: The model classifies individual sentences and may not perform well on multi-sentence contexts.
@inproceedings{JdFE2025b,
title = {Emotion Classification with ModernBERT},
author = {Enric Junqu\'e de Fortuny},
year = {2025},
howpublished = {\url{https://huggingface.co/your_model_name_here}},
}
Runs of cirimus modernbert-base-emotions on huggingface.co
81
Total runs
0
24-hour runs
-16
3-day runs
-35
7-day runs
-76
30-day runs
More Information About modernbert-base-emotions huggingface.co Model
modernbert-base-emotions huggingface.co is an AI model on huggingface.co that provides modernbert-base-emotions's model effect (), which can be used instantly with this cirimus modernbert-base-emotions model. huggingface.co supports a free trial of the modernbert-base-emotions model, and also provides paid use of the modernbert-base-emotions. Support call modernbert-base-emotions model through api, including Node.js, Python, http.
modernbert-base-emotions huggingface.co is an online trial and call api platform, which integrates modernbert-base-emotions's modeling effects, including api services, and provides a free online trial of modernbert-base-emotions, you can try modernbert-base-emotions online for free by clicking the link below.
cirimus modernbert-base-emotions online free url in huggingface.co:
modernbert-base-emotions is an open source model from GitHub that offers a free installation service, and any user can find modernbert-base-emotions on GitHub to install. At the same time, huggingface.co provides the effect of modernbert-base-emotions install, users can directly use modernbert-base-emotions installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
modernbert-base-emotions install url in huggingface.co: