Downloads Β· 30 days
8
12% of all-time downloads
VineetSingh10/my-emotion-classifier
my-emotion-classifier is a text classification model from VineetSingh10. 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 is a fine-tuned DistilBERT model for emotion classification. It can classify text into 6 different emotions: - π’ Sadness - π Joy - β€οΈ Love - π Anger - π¨ Fear - π² Surprise
Downloads Β· 30 days
8
12% of all-time downloads
All-time downloads
69
Public
Parameters
67M
2.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt1.6 GB Β· 60%
From the Hugging Face model README
This is a fine-tuned DistilBERT model for emotion classification. It can classify text into 6 different emotions:
Base Model: distilbert-base-uncased
Fine-tuned on: emotion dataset
Task: Multi-class text classification
Language: English
The model achieves approximately:
from transformers import pipeline
# Load the model
classifier = pipeline("text-classification", model="YOUR_USERNAME/my-emotion-classifier")
# Make predictions
text = "I love this so much! Best day ever!"
result = classifier(text)
print(result)
# [{'label': 'joy', 'score': 0.95}]
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("YOUR_USERNAME/my-emotion-classifier")
model = AutoModelForSequenceClassification.from_pretrained("YOUR_USERNAME/my-emotion-classifier")
# Tokenize and predict
text = "This makes me so angry!"
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
outputs = model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
predicted_class = torch.argmax(predictions, dim=-1).item()
print(f"Predicted emotion: {model.config.id2label[predicted_class]}")
# Install the transformers library
pip install transformers
# Use the model in Python
python -c "from transformers import pipeline; classifier = pipeline('text-classification', model='YOUR_USERNAME/my-emotion-classifier'); print(classifier('I am so happy!'))"
| Text | Predicted Emotion | Confidence |
|---|---|---|
| "I love this so much!" | joy | 0.95 |
| "This is terrible!" | anger | 0.88 |
| "I'm really scared" | fear | 0.92 |
| "What a surprise!" | surprise | 0.86 |
The model was fine-tuned on the emotion dataset which contains:
This model should not be used for:
If you use this model, please cite:
@misc{my-emotion-classifier,
author = {Your Name},
title = {My Emotion Classifier},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/YOUR_USERNAME/my-emotion-classifier}}
}
For questions or feedback, please open an issue on the model's Hugging Face page.