🚀 Fine-tuned RoBERTa Model for Emotion Classification in German
This model is fine - tuned from RoBERTa, specifically designed for emotion classification in German, classifying text into six emotional categories.
🚀 Quick Start
You can use this model directly with the transformers
library from Hugging Face. Below is an example of how to load and use the model:
from transformers import pipeline
classifier = pipeline("text-classification", model="visegradmedia-emotion/Emotion_RoBERTa_german6_v7")
result = classifier("Heute fühle ich mich sehr glücklich!")
print(result)
✨ Features
- Specifically tailored for emotion classification tasks in German.
- Trained to classify textual data into six emotional categories: anger, fear, disgust, sadness, joy, and none of them.
- Can be used in applications such as sentiment analysis, social media monitoring, and customer feedback analysis.
📦 Installation
There is no specific installation process described in the original document. If using the transformers
library, you can install it via pip install transformers
.
💻 Usage Examples
Basic Usage
from transformers import pipeline
classifier = pipeline("text-classification", model="visegradmedia-emotion/Emotion_RoBERTa_german6_v7")
result = classifier("Heute fühle ich mich sehr glücklich!")
print(result)
Advanced Usage
texts = ["Heute fühle ich mich sehr glücklich!", "Ich habe Angst vor der Zukunft."]
results = classifier(texts)
print(results)
📚 Documentation
Model Description
This model, named Emotion_RoBERTa_german6_v7, is a fine - tuned version of the RoBERTa model, specifically tailored for emotion classification tasks in German. The model was trained to classify textual data into six emotional categories (anger, fear, disgust, sadness, joy, and none of them).
Intended Use
This model is intended for classifying textual data into emotional categories in the German language. It can be used in applications such as sentiment analysis, social media monitoring, customer feedback analysis, and similar tasks. The model predicts the dominant emotion in a given text among the six predefined categories.
Metrics
Class |
Precision (P) |
Recall (R) |
F1-Score (F1) |
anger |
0.69 |
0.79 |
0.74 |
fear |
0.96 |
0.99 |
0.98 |
disgust |
0.94 |
0.95 |
0.95 |
sadness |
0.88 |
0.84 |
0.86 |
joy |
0.89 |
0.87 |
0.88 |
none of them |
0.74 |
0.64 |
0.69 |
Accuracy |
|
|
0.81 |
Macro Avg |
0.85 |
0.85 |
0.85 |
Weighted Avg |
0.85 |
0.81 |
0.81 |
Overall Performance
- Accuracy: 0.81
- Macro Average Precision: 0.85
- Macro Average Recall: 0.85
- Macro Average F1-Score: 0.85
Class-wise Performance
The model demonstrates strong performance in the fear, disgust, and joy categories, with particularly high precision, recall, and F1 scores. The model performs moderately well in detecting anger and none of them categories, indicating potential areas for improvement.
Limitations
- Context Sensitivity: The model may struggle with recognizing emotions that require deeper contextual understanding.
- Class Imbalance: The model's performance on the "none of them" category suggests that further training with more balanced datasets could improve accuracy.
- Generalization: The model's performance may vary depending on the text's domain, language style, and length, especially across different languages.
Training Data
The model was fine - tuned on a custom German dataset containing textual samples labeled across six emotional categories. The dataset's distribution was considered during training to ensure balanced performance across classes.
🔧 Technical Details
- Model Type: Fine - tuned RoBERTa
- Training Data: A custom German dataset with textual samples labeled across six emotional categories
Property |
Details |
Model Type |
Fine - tuned RoBERTa |
Training Data |
A custom German dataset with textual samples labeled across six emotional categories |
Limitations Analysis
- Context Sensitivity: Emotions that rely on in - depth context are difficult for the model to recognize.
- Class Imbalance: The performance on the "none of them" category shows that more balanced datasets could enhance accuracy.
- Generalization: The model's performance may vary with text domain, language style, and length, especially in different languages.
📄 License
This model is released under the MIT license.