Downloads · 30 days
18
3% of all-time downloads
Sathwik3/distilbert-emotion-classifier
distilbert-emotion-classifier is a text classification model from Sathwik3. 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 for multi-class emotion classification. The model classifies text into different emotional categories, enabling applications in sentiment analysis, custome…
Downloads · 30 days
18
3% of all-time downloads
All-time downloads
544
Public
Parameters
67M
536 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 for multi-class emotion classification. The model classifies text into different emotional categories, enabling applications in sentiment analysis, customer feedback analysis, and social media monitoring.
Developed by: Sathwik3
Model type: Text Classification (Emotion Detection)
Language(s): English
License: Apache 2.0
Base model: distilbert-base-uncased
The model is based on DistilBERT, a distilled version of BERT that retains 97% of BERT's language understanding while being 40% smaller and 60% faster. The architecture consists of:
The model was fine-tuned using cross-entropy loss for multi-class classification, optimizing for accurate emotion categorization across multiple emotional states.
The model can be directly used for:
This model can be integrated into larger systems for:
The model should not be used for:
Use the code below to get started with the model:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
model_name = "Sathwik3/distilbert-emotion-classifier"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Example text
text = "I am so happy and excited about this amazing opportunity!"
# Tokenize and predict
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
predicted_class = torch.argmax(predictions, dim=-1).item()
print(f"Predicted emotion class: {predicted_class}")
print(f"Confidence scores: {predictions}")
For pipeline usage:
from transformers import pipeline
# Create emotion classification pipeline
emotion_classifier = pipeline("text-classification", model="Sathwik3/distilbert-emotion-classifier")
# Classify emotion
result = emotion_classifier("I am so happy and excited about this amazing opportunity!")
print(result)
The model was fine-tuned on an emotion classification dataset. Specific dataset details:
The model's performance is evaluated using:
| Metric | Value |
|---|---|
| Accuracy | 0.9295 |
| Weighted F1 | 0.9292 |
If you use this model in your research or applications, please cite:
BibTeX:
@misc{sathwik3-distilbert-emotion,
author = {Sathwik3},
title = {DistilBERT Emotion Classifier},
year = {2024},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/Sathwik3/distilbert-emotion-classifier}}
}
Please also cite the original DistilBERT paper:
@article{sanh2019distilbert,
title={DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter},
author={Sanh, Victor and Debut, Lysandre and Chaumond, Julien and Wolf, Thomas},
journal={arXiv preprint arXiv:1910.01108},
year={2019}
}
APA:
Sathwik3. (2024). DistilBERT Emotion Classifier. Hugging Face. https://huggingface.co/Sathwik3/distilbert-emotion-classifier
Sathwik3
For questions or feedback about this model, please open an issue in the model's repository or contact via Hugging Face.
This model card follows the guidelines from Mitchell et al. (2019) and the Hugging Face Model Card template.