Views
No views yet
distilbert-base-uncased on the GoEmotions (Simplified) dataset — a multi-label emotion classification task with 28 emotion categories.sigmoid + BCEWithLogitsLoss and supports multiple simultaneous emotion predictions per sentence.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 Trainer1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model = AutoModelForSequenceClassification.from_pretrained("TuhinG/distilbert-goemotions")
5tokenizer = AutoTokenizer.from_pretrained("TuhinG/distilbert-goemotions")
6
7text = "I'm feeling excited and a little nervous about tomorrow."
8inputs = tokenizer(text, return_tensors="pt")
9
10with torch.no_grad():
11 logits = model(**inputs).logits
12 probs = torch.sigmoid(logits)[0]
13
14# Threshold and map to labels
15emotions = [
16 "admiration", "amusement", "anger", "annoyance", "approval", "caring", "confusion", "curiosity",
17 "desire", "disappointment", "disapproval", "embarrassment", "excitement", "fear", "gratitude", "grief",
18 "joy", "love", "nervousness", "optimism", "pride", "realization", "relief", "remorse", "sadness",
19 "surprise", "neutral"
20]
21
22for i, prob in enumerate(probs):
23 if prob > 0.5:
24 print(f"{emotions[i]}: {prob:.2f}")f1_micro: high recall on rare labelsf1_macro: balanced performance across labels
---
## ✅ 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"
)