Downloads · 30 days
5
5% of all-time downloads
mariadelcarmenramirez/metaphor-cat-roberta-base-weights
metaphor-cat-roberta-base-weights is a token classification model from mariadelcarmenramirez. Use it when you need labels on individual words, such as names. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of projecte-aina/roberta-base-ca-v2 for metaphor detection in Catalan text using the dataset metaphor-catalan.
Downloads · 30 days
5
5% of all-time downloads
All-time downloads
95
Public
Parameters
124M
992 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors496 MB · 99%
From the Hugging Face model README
This model is a fine-tuned version of projecte-aina/roberta-base-ca-v2 for metaphor detection in Catalan text using the dataset metaphor-catalan.
It performs token classification, identifying which tokens belong to metaphorical expressions using a BIO tagging scheme.
Evaluation results on the validation set:
This model is a RoBERTa-based transformer for Catalan NLP fine-tuned for token-level metaphor detection.
The model predicts whether each token in a sentence belongs to a metaphorical expression using the following BIO labeling scheme:
The task is framed as token classification, where each token receives a label indicating whether it is part of a metaphor span.
Because metaphor tokens are significantly less frequent than literal tokens, class-weighted loss was applied during training to mitigate class imbalance.
This model can support research on figurative language detection in Catalan, computational linguistics experiments, and NLP pipelines requiring semantic analysis of figurative language.
This model can be used for:
Typical usage scenarios include:
The model should therefore be used as an assistive tool rather than a definitive annotation system.
Training dataset:
metaphor-catalan
This dataset contains Catalan sentences annotated for metaphorical expressions using token-level BIO labels.
Each example contains:
tokens — tokenized sentencetags — BIO labels indicating metaphor spansLabel scheme used during training:
| Label | Description |
|---|---|
| O | Non-metaphorical token |
| B-METAPHOR | Beginning of metaphor |
| I-METAPHOR | Continuation of metaphor |
The dataset exhibits strong class imbalance, with metaphor tokens occurring much less frequently than literal tokens. To address this, class weights were applied during training.
Example label distribution used during training:
O: 6089 tokensB-METAPHOR: 325 tokensI-METAPHOR: extremely rare / absent in some splitsprojecte-aina/roberta-base-ca-v2.Training was performed using the Hugging Face Transformers Trainer API.
Key elements:
2e-54428100.1linear5020AdamWAMP| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy |
|---|---|---|---|---|---|---|---|
| — | 1 | 66 | 0.7492 | 0.2000 | 0.0476 | 0.0769 | 0.9426 |
| 0.8617 | 2 | 132 | 0.5231 | 0.2238 | 0.7619 | 0.3459 | 0.8553 |
| 0.8617 | 3 | 198 | 0.5649 | 0.3571 | 0.5952 | 0.4464 | 0.9258 |
| 0.4759 | 4 | 264 | 0.6743 | 0.6286 | 0.5238 | 0.5714 | 0.9605 |
| 0.3202 | 5 | 330 | 0.6171 | 0.6970 | 0.5476 | 0.6133 | 0.9653 |
| 0.3202 | 6 | 396 | 0.6861 | 0.6875 | 0.5238 | 0.5946 | 0.9641 |
| 0.2365 | 7 | 462 | 0.6396 | 0.6857 | 0.5714 | 0.6234 | 0.9653 |
| 0.1962 | 8 | 528 | 0.6864 | 0.7273 | 0.5714 | 0.6400 | 0.9677 |
| 0.1962 | 9 | 594 | 0.7467 | 0.6875 | 0.5238 | 0.5946 | 0.9641 |
| 0.1589 | 10 | 660 | 0.7232 | 0.7188 | 0.5476 | 0.6216 | 0.9665 |