Text Classification
Transformers
Safetensors
English
deberta
debarta
debarta-xlarge
emotions-classifier
Instructions to use AnkitAI/deberta-xlarge-base-emotions-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AnkitAI/deberta-xlarge-base-emotions-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AnkitAI/deberta-xlarge-base-emotions-classifier")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("AnkitAI/deberta-xlarge-base-emotions-classifier") model = AutoModelForSequenceClassification.from_pretrained("AnkitAI/deberta-xlarge-base-emotions-classifier", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from AnkitAI/deberta-xlarge-base-emotions-classifier: direct link, hf CLI and curl.
- Browser
- Download file 3.74 kB
-
https://huggingface.co/AnkitAI/deberta-xlarge-base-emotions-classifier/resolve/eb2c072f84778115e1212fe20d30c40dd8c5ec9a/README.md
- Command line
-
hf download hf://AnkitAI/deberta-xlarge-base-emotions-classifier@eb2c072f84778115e1212fe20d30c40dd8c5ec9a/README.md
-
curl -L -o README.md https://huggingface.co/AnkitAI/deberta-xlarge-base-emotions-classifier/resolve/eb2c072f84778115e1212fe20d30c40dd8c5ec9a/README.md
3.74 kB
| base_model: microsoft/deberta-xlarge-mnli | |
| 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-xlarge | |
| - emotions-classifier | |
|  | |
| # Emotion-X: Fine-tuned DeBERTa-Xlarge Based Emotion Detection | |
| This 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. | |
| ## Overview | |
| Emotion-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. | |
| ## Model Details | |
| - **Model Name:** `AnkitAI/deberta-xlarge-base-emotions-classifier` | |
| - **Base Model:** `microsoft/deberta-xlarge-mnli` | |
| - **Dataset:** [dair-ai/emotion](https://huggingface.co/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 | |
| - **Evaluation Loss:** 0.0858 | |
| - **Evaluation Runtime:** 110070.6349 seconds | |
| - **Evaluation Samples/Second:** 78.495 | |
| - **Evaluation Steps/Second:** 2.453 | |
| - **Training Loss:** 0.1049 | |
| - **Evaluation Accuracy:** 94.6% | |
| - **Evaluation Precision:** 94.8% | |
| - **Evaluation Recall:** 94.5% | |
| - **Evaluation F1 Score:** 94.7% | |
| ## Usage | |
| You can use this model directly with the Hugging Face `transformers` library: | |
| ```python | |
| from transformers import AutoModelForSequenceClassification, AutoTokenizer | |
| model_name = "AnkitAI/deberta-xlarge-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-xlarge-mnli | | |
| | Training Dataset | dair-ai/emotion | | |
| | 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](LICENSE). | |
| More models: [ankitaglawe.com](https://ankitaglawe.com) | |
| --- | |
| ## Support the Project | |
| If these models help your research or products, consider supporting independent research: | |
| <p align="left"> | |
| <a href="https://www.buymeacoffee.com/AnkitAI" target="_blank"> | |
| <img src="https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20coffee&emoji=&slug=AnkitAI&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" alt="Buy Me A Coffee" /> | |
| </a> | |
| </p> | |