dair-ai/emotion
Viewer • Updated • 437k • 20.3k • 457
How to use HR26kk/modernbert-emotion-classifier with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="HR26kk/modernbert-emotion-classifier") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("HR26kk/modernbert-emotion-classifier")
model = AutoModelForSequenceClassification.from_pretrained("HR26kk/modernbert-emotion-classifier", device_map="auto")A fine-grained, 6-class emotion classification model built on top of answerdotai/ModernBERT-base (149M parameters) and trained on the dair-ai/emotion benchmark.
sadness, joy, love, anger, fear, surprise)| Evaluation Metric | Score |
|---|---|
| Accuracy | 92.25% |
| Macro F1 | 87.02% |
| Weighted F1 | 92.15% |
| Weighted Precision | 92.16% |
| Weighted Recall | 92.25% |
precision recall f1-score support
sadness 0.9652 0.9535 0.9593 581
joy 0.9371 0.9640 0.9504 695
love 0.8699 0.7987 0.8328 159
anger 0.9061 0.9127 0.9094 275
fear 0.8596 0.9018 0.8802 224
surprise 0.7736 0.6212 0.6891 66
from transformers import pipeline
classifier = pipeline("text-classification", model="HR26kk/modernbert-emotion-classifier")
result = classifier("I am genuinely proud of what we accomplished today.")
print(result)