Downloads · 30 days
5
7% of all-time downloads
Subhra-123/distilbert-base-emotion
distilbert-base-emotion is a machine learning model from Subhra-123. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is a fine-tuned version of distilbert-base-uncased for emotion classification. It predicts the emotion expressed in a given text such as joy, sadness, anger, fear, love, surprise, etc.
Downloads · 30 days
5
7% of all-time downloads
All-time downloads
73
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB · 99%
From the Hugging Face model README
This model is a fine-tuned version of distilbert-base-uncased for emotion classification.
It predicts the emotion expressed in a given text such as joy, sadness, anger, fear, love, surprise, etc.
from transformers import pipeline
pipe = pipeline("text-classification", model="Subhra-123/distilbert-base-emotion", return_all_scores=True)
text = "I love my friends!"
pred = pipe(text)[0]
emotion = max(pred, key=lambda x: x['score'])
print(f"{text} → {emotion['label']} ({emotion['score']:.2f})")