Downloads · 30 days
38
5% of all-time downloads
TuhinG/distilbert-goemotions
distilbert-goemotions is a text classification model from TuhinG. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of distilbert-base-uncased on the GoEmotions (Simplified) dataset — a multi-label emotion classification task with 28 emotion categories.
Downloads · 30 days
38
5% of all-time downloads
All-time downloads
810
Public
Parameters
67M
268 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors268 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of distilbert-base-uncased on the GoEmotions (Simplified) dataset — a multi-label emotion classification task with 28 emotion categories.
It uses sigmoid + BCEWithLogitsLoss and supports multiple simultaneous emotion predictions per sentence.
There are 28 possible emotions, including:
admiration, amusement, anger, annoyance, approval, caring, confusion, curiosity, desire, disappointment, disapproval, embarrassment, excitement, fear, gratitude, grief, joy, love, nervousness, optimism, pride, realization, relief, remorse, sadness, surprise, neutral
distilbert-base-uncasedgo_emotions (simplified version with 28 labels)BCEWithLogitsLoss (enabled via problem_type="multi_label_classification")transformers Trainerfrom transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model = AutoModelForSequenceClassification.from_pretrained("TuhinG/distilbert-goemotions")
tokenizer = AutoTokenizer.from_pretrained("TuhinG/distilbert-goemotions")
text = "I'm feeling excited and a little nervous about tomorrow."
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.sigmoid(logits)[0]
# Threshold and map to labels
emotions = [
"admiration", "amusement", "anger", "annoyance", "approval", "caring", "confusion", "curiosity",
"desire", "disappointment", "disapproval", "embarrassment", "excitement", "fear", "gratitude", "grief",
"joy", "love", "nervousness", "optimism", "pride", "realization", "relief", "remorse", "sadness",
"surprise", "neutral"
]
for i, prob in enumerate(probs):
if prob > 0.5:
print(f"{emotions[i]}: {prob:.2f}")
During training, micro and macro F1 scores were used:
f1_micro: high recall on rare labelsf1_macro: balanced performance across labelsFine-tuned and maintained by TuhinG
Apache 2.0 — free to use, share, and modify.
---
## ✅ Next Steps
You can now:
1. Copy this to a file: `README.md`
2. Place it inside your model folder (`./distilbert_emotion_model`)
3. Push it to Hugging Face again:
```python
from huggingface_hub import upload_folder
upload_folder(
folder_path="./distilbert_emotion_model",
repo_id="TuhinG/distilbert-goemotions",
repo_type="model",
commit_message="Add model card README"
)
Let me know if you'd like me to generate the Python code for pushing this, or if you'd like to preview the model page before making it public.