Downloads · 30 days
25
31% of all-time downloads
Gandhiert/emotion-multilabel-distilbert
emotion-multilabel-distilbert is a text classification model from Gandhiert. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
🎭 A fine-tuned DistilBERT model for multilabel emotion classification on text data.
Downloads · 30 days
25
31% of all-time downloads
All-time downloads
81
Public
Parameters
66.4M
266 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors266 MB · 100%
From the Hugging Face model README
🎭 A fine-tuned DistilBERT model for multilabel emotion classification on text data.
This model is fine-tuned from distilbert-base-uncased for multilabel emotion classification. It can predict multiple emotions simultaneously from text input across 14 different emotion categories.
The model can predict the following 14 emotions: ['amusement', 'anger', 'annoyance', 'caring', 'confusion', 'disappointment', 'disgust', 'embarrassment', 'excitement', 'fear', 'gratitude', 'joy', 'love', 'sadness']
from transformers import AutoTokenizer, AutoModel
import torch
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("your-username/emotion-multilabel-distilbert")
model = AutoModel.from_pretrained("your-username/emotion-multilabel-distilbert")
# Example usage
text = "I'm so happy and excited about this project!"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=128)
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.sigmoid(outputs.logits)
# Get emotions above threshold (0.5)
emotions = []
for i, prob in enumerate(predictions[0]):
if prob > 0.5:
emotions.append(emotion_columns[i])
print(f"Predicted emotions: {', '.join(emotions)}")
This model is released under the MIT License.