AnkitAI/deberta-xlarge-base-emotions-classifier
243
1---2base_model: microsoft/deberta-xlarge-mnli3license: mit4datasets:5- dair-ai/emotion6language:7- en8library_name: transformers9widget:10- text: I am so happy with the results!11- text: I am so pissed with the results!12tags:13- debarta14- debarta-xlarge15- emotions-classifier16---17 1819 20# Emotion-X: Fine-tuned DeBERTa-Xlarge Based Emotion Detection21 22This is a fine-tuned version of [microsoft/deberta-xlarge-mnli](https://huggingface.co/microsoft/deberta-xlarge-mnli) for emotion detection on the [dair-ai/emotion](https://huggingface.co/dair-ai/emotion) dataset.23 24## Overview25 26Emotion-X is a state-of-the-art emotion detection model fine-tuned from Microsoft's DeBERTa-Xlarge model. Designed to accurately classify text into one of six emotional categories, Emotion-X leverages the robust capabilities of DeBERTa and fine-tunes it on a comprehensive emotion dataset, ensuring high accuracy and reliability.27 28## Model Details29 30- **Model Name:** `AnkitAI/deberta-xlarge-base-emotions-classifier`31- **Base Model:** `microsoft/deberta-xlarge-mnli`32- **Dataset:** [dair-ai/emotion](https://huggingface.co/dair-ai/emotion)33- **Fine-tuning:** This model was fine-tuned for emotion detection with a classification head for six emotional categories (anger, disgust, fear, joy, sadness, surprise).34 35## Training36 37The model was trained using the following parameters:38 39- **Learning Rate:** 2e-540- **Batch Size:** 441- **Weight Decay:** 0.0142- **Evaluation Strategy:** Epoch43 44### Training Details45 46- **Evaluation Loss:** 0.085847- **Evaluation Runtime:** 110070.6349 seconds48- **Evaluation Samples/Second:** 78.49549- **Evaluation Steps/Second:** 2.45350- **Training Loss:** 0.104951- **Evaluation Accuracy:** 94.6%52- **Evaluation Precision:** 94.8%53- **Evaluation Recall:** 94.5%54- **Evaluation F1 Score:** 94.7%55 56## Usage57 58You can use this model directly with the Hugging Face `transformers` library:59 60```python61from transformers import AutoModelForSequenceClassification, AutoTokenizer62 63model_name = "AnkitAI/deberta-xlarge-base-emotions-classifier"64model = AutoModelForSequenceClassification.from_pretrained(model_name)65tokenizer = AutoTokenizer.from_pretrained(model_name)66 67# Example usage68def predict_emotion(text):69 inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=128)70 outputs = model(**inputs)71 logits = outputs.logits72 predictions = logits.argmax(dim=1)73 return predictions74 75text = "I'm so happy with the results!"76emotion = predict_emotion(text)77print("Detected Emotion:", emotion)78```79 80## Emotion Labels81- Anger82- Disgust83- Fear84- Joy85- Sadness86- Surprise87 88## Model Card Data89 90| Parameter | Value |91|-------------------------------|------------------------------|92| Model Name | microsoft/deberta-xlarge-mnli |93| Training Dataset | dair-ai/emotion |94| Learning Rate | 2e-5 |95| Per Device Train Batch Size | 4 |96| Evaluation Strategy | Epoch |97| Best Model Accuracy | 94.6% |98 99## Support the Project100 101If this model is useful in your work, you can support independent research:102 103<p align="left">104 <a href="https://www.buymeacoffee.com/AnkitAI" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me a Coffee" height="60" width="217" /></a>105</p>106 107## License108 109This model is licensed under the [MIT License](LICENSE).110 111More models: [ankitaglawe.com](https://ankitaglawe.com)112 