Text Classification
Transformers
Safetensors
English
deberta-v2
debarta
debarta-v3-small
emotions-classifier
text-embeddings-inference
Instructions to use AnkitAI/deberta-v3-small-base-emotions-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AnkitAI/deberta-v3-small-base-emotions-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AnkitAI/deberta-v3-small-base-emotions-classifier")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("AnkitAI/deberta-v3-small-base-emotions-classifier") model = AutoModelForSequenceClassification.from_pretrained("AnkitAI/deberta-v3-small-base-emotions-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from AnkitAI/deberta-v3-small-base-emotions-classifier: direct link, hf CLI and curl.
- Browser
- Download file 3.35 kB
-
https://huggingface.co/AnkitAI/deberta-v3-small-base-emotions-classifier/resolve/d80beeef2e409908187e966d195869908b12bcda/README.md
- Command line
-
hf download hf://AnkitAI/deberta-v3-small-base-emotions-classifier@d80beeef2e409908187e966d195869908b12bcda/README.md
-
curl -L -o README.md https://huggingface.co/AnkitAI/deberta-v3-small-base-emotions-classifier/resolve/d80beeef2e409908187e966d195869908b12bcda/README.md
3.35 kB
metadata
license: mit
datasets:
- dair-ai/emotion
language:
- en
library_name: transformers
widget:
- text: I am so happy with the results!
- text: I am so pissed with the results!
tags:
- debarta
- debarta-v3-small
- emotions-classifier
π Fast Emotion-X: Fine-tuned DeBERTa V3 Small Based Emotion Detection π
This is a fine-tuned version of microsoft/deberta-v3-small for emotion detection on the dair-ai/emotion dataset.
π Overview
Fast Emotion-X is a state-of-the-art emotion detection model fine-tuned from Microsoft's DeBERTa V3 Small model. Designed to accurately classify text into one of six emotional categories, Fast Emotion-X leverages the robust capabilities of DeBERTa and fine-tunes it on a comprehensive emotion dataset, ensuring high accuracy and reliability.
π Model Details
- π Model Name:
AnkitAI/deberta-v3-small-base-emotions-classifier - π Base Model:
microsoft/deberta-v3-small - π Dataset: dair-ai/emotion
- βοΈ Fine-tuning: This model was fine-tuned for emotion detection with a classification head for six emotional categories (anger, disgust, fear, joy, sadness, surprise).
ποΈ Training
The model was trained using the following parameters:
- π§ Learning Rate: 2e-5
- π¦ Batch Size: 4
- βοΈ Weight Decay: 0.01
- π Evaluation Strategy: Epoch
ποΈ Training Details
- π Eval Loss: 0.0858
- β±οΈ Eval Runtime: 110070.6349 seconds
- π Eval Samples/Second: 78.495
- π Eval Steps/Second: 2.453
- π Train Loss: 0.1049
- β³ Eval Accuracy: 94.6%
- π Eval Precision: 94.8%
- β±οΈ Eval Recall: 94.5%
- π Eval F1 Score: 94.7%
π Usage
You can use this model directly with the Hugging Face transformers library:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_name = "AnkitAI/deberta-v3-small-base-emotions-classifier"
model = AutoModelForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Example usage
def predict_emotion(text):
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=128)
outputs = model(**inputs)
logits = outputs.logits
predictions = logits.argmax(dim=1)
return predictions
text = "I'm so happy with the results!"
emotion = predict_emotion(text)
print("Detected Emotion:", emotion)
π Emotion Labels
- π Anger
- π€’ Disgust
- π¨ Fear
- π Joy
- π’ Sadness
- π² Surprise
π Model Card Data
| Parameter | Value |
|---|---|
| Model Name | microsoft/deberta-v3-small |
| Training Dataset | dair-ai/emotion |
| Number of Training Epochs | 20 |
| Learning Rate | 2e-5 |
| Per Device Train Batch Size | 4 |
| Evaluation Strategy | Epoch |
| Best Model Accuracy | 94.6% |
π License
This model is licensed under the MIT License.