|
--- |
|
library_name: transformers |
|
license: mit |
|
base_model: dbmdz/bert-base-italian-xxl-uncased |
|
tags: |
|
- generated_from_trainer |
|
metrics: |
|
- accuracy |
|
- f1 |
|
model-index: |
|
- name: bert-base-italian-xxl-uncased-italian-finetuned-emotions |
|
results: [] |
|
--- |
|
|
|
<!-- This model card has been generated automatically according to the information the Trainer had access to. You |
|
should probably proofread and complete it, then remove this comment. --> |
|
|
|
# bert-base-italian-xxl-uncased-italian-finetuned-emotions |
|
|
|
This model is a fine-tuned version of [dbmdz/bert-base-italian-xxl-uncased](https://huggingface.co/dbmdz/bert-base-italian-xxl-uncased) on an unknown dataset. |
|
This model is a fine-tuned version of dbmdz/bert-base-italian-xxl-uncased specifically for emotion classification in Italian text. The model is trained to classify text into seven emotions: |
|
|
|
- Joy |
|
- Sadness |
|
- Anger |
|
- Fear |
|
- Disgust |
|
- Surprise |
|
- Neutral |
|
- |
|
It achieves high performance on the evaluation dataset, making it suitable for tasks requiring emotional tone analysis of Italian text. |
|
|
|
It achieves the following results on the evaluation set: |
|
- Loss: 0.5546 |
|
- Accuracy: 0.9877 |
|
- F1: 0.9876 |
|
|
|
## Model description |
|
|
|
Model description |
|
The model is based on the BERT architecture with an uncased vocabulary and is fine-tuned for emotion detection in Italian texts. It uses the transformer architecture, which relies on attention mechanisms for context comprehension in sequences. This fine-tuned model improves performance for tasks like social media sentiment analysis, customer feedback interpretation, and conversational agents. |
|
|
|
|
|
## Intended uses & limitations |
|
|
|
Intended uses & limitations |
|
Intended uses: |
|
- Emotion analysis of text in Italian. |
|
- Sentiment classification for customer service or social media posts. |
|
- Research in natural language understanding related to emotions in Italian. |
|
Limitations: |
|
- The model is fine-tuned on an undisclosed dataset and may not generalize well to certain domains. |
|
- Emotion detection models might struggle with texts containing sarcasm, irony, or complex multi-emotion sentences. |
|
- |
|
Training and evaluation data |
|
This model was fine-tuned on a custom dataset labeled with seven emotions (joy, sadness, anger, fear, disgust, surprise, neutral). The dataset includes Italian text samples, likely drawn from conversational or written contexts where emotion detection is relevant. |
|
|
|
# How To Use It |
|
You can use this model with the transformers library in Python: |
|
|
|
``` |
|
from transformers import AutoTokenizer, AutoModelForSequenceClassification |
|
from transformers import pipeline |
|
|
|
tokenizer = AutoTokenizer.from_pretrained("dbmdz/bert-base-italian-xxl-uncased") |
|
|
|
model = AutoModelForSequenceClassification.from_pretrained("MelmaGrigia/bert-base-italian-xxl-uncased-italian-finetuned-emotions") |
|
|
|
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer) |
|
result = classifier("Questo è un testo di esempio.") |
|
print(result) |
|
|
|
``` |
|
|
|
## Training procedure |
|
|
|
### Training hyperparameters |
|
|
|
The following hyperparameters were used during training: |
|
- learning_rate: 2e-05 |
|
- train_batch_size: 64 |
|
- eval_batch_size: 64 |
|
- seed: 42 |
|
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08 |
|
- lr_scheduler_type: linear |
|
- num_epochs: 2 |
|
|
|
### Training results |
|
|
|
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 | |
|
|:-------------:|:-----:|:----:|:---------------:|:--------:|:------:| |
|
| No log | 1.0 | 29 | 0.9305 | 0.9571 | 0.9561 | |
|
| No log | 2.0 | 58 | 0.5546 | 0.9877 | 0.9876 | |
|
|
|
|
|
### Framework versions |
|
|
|
- Transformers 4.44.2 |
|
- Pytorch 2.4.0+cu121 |
|
- Datasets 3.0.0 |
|
- Tokenizers 0.19.1 |
|
|