cardiffnlp/tweet_sentiment_multilingual
Viewer • Updated • 48.5k • 3.25k • 24
How to use lbryanrick/beto-sentiment-es-tweets with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="lbryanrick/beto-sentiment-es-tweets") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("lbryanrick/beto-sentiment-es-tweets")
model = AutoModelForSequenceClassification.from_pretrained("lbryanrick/beto-sentiment-es-tweets")Clasificador de polaridad afectiva en español (3 clases: negative, neutral, positive) obtenido haciendo fine-tuning de BETO sobre el subconjunto en español de cardiffnlp/tweet_sentiment_multilingual.
from transformers import pipeline
clf = pipeline("text-classification", model="lbryanrick/beto-sentiment-es-tweets")
clf("La película me pareció maravillosa, muy recomendada.")
# -> [{'label': 'positive', 'score': 0.97}]
cardiffnlp/tweet_sentiment_multilingual (split spanish)| Métrica | Valor |
|---|---|
| Accuracy | 0.6862 |
| F1 macro | 0.6859 |
| Clase | Precision | Recall | F1 |
|---|---|---|---|
| negative | 0.6950 | 0.7621 | 0.7270 |
| neutral | 0.5951 | 0.5828 | 0.5889 |
| positive | 0.7724 | 0.7138 | 0.7419 |
Estos resultados son comparables con el baseline XLM-R reportado en Barbieri et al. (2022) para el split en español del dataset, alcanzado con un modelo más pequeño (BETO base, 110M parámetros) y sin pre-entrenamiento específico de dominio social.
Semilla: 42. Hiperparámetros:
| Hiperparámetro | Valor |
|---|---|
learning_rate |
2e-5 |
per_device_train_batch_size |
16 |
num_train_epochs |
3 |
weight_decay |
0.01 |
max_length |
128 |
fp16 |
True |
@inproceedings{CaneteCFP2020,
title={Spanish Pre-Trained BERT Model and Evaluation Data},
author={Cañete, José and Chaperon, Gabriel and Fuentes, Rodrigo and Ho, Jou-Hui and Kang, Hojin and Pérez, Jorge},
booktitle={PML4DC at ICLR 2020},
year={2020}
}
@inproceedings{barbieri-etal-2022-xlm,
title={{XLM}-{T}: Multilingual Language Models in {T}witter for Sentiment Analysis and Beyond},
author={Barbieri, Francesco and Espinosa Anke, Luis and Camacho-Collados, Jose},
booktitle={Proceedings of LREC},
year={2022}
}
Base model
dccuchile/bert-base-spanish-wwm-cased