Downloads · 30 days
43
0% of all-time downloads
Newtral/xlm-r-finetuned-toxic-political-tweets-es
xlm-r-finetuned-toxic-political-tweets-es is a text classification model from Newtral. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This model is based on the pre-trained model xlm-roberta-base and was fine-tuned on a dataset of tweets from members of the Spanish Congress of the Deputies annotated regarding the level of political toxicity they gen…
Downloads · 30 days
43
0% of all-time downloads
All-time downloads
16.5K
Public
Parameters
278M
5.6 GB on disk
Likes
7
Public
Click a slice to open those files.
.bin1.1 GB · 50%
How the weights are stored.
F32278M · 100%
From the Hugging Face model README
This model is based on the pre-trained model xlm-roberta-base and was fine-tuned on a dataset of tweets from members of the Spanish Congress of the Deputies annotated regarding the level of political toxicity they generate.
The model has been trained on the text of Spanish tweets authored by politicians in 2021, so this is the input expected and its performance can degrade when applied to texts from other domains.
The model predicts 2 signals of political toxicity:
A value between 0 and 1 is predicted for each signal.
The model was created to be used as a toxicity detector of spanish tweets from Spanish Congress Deputies. If the intended use is other one, for instance; toxicity detection on films reviews, the results won't be reliable and you might look for another model with this concrete purpose.
The model can be used directly with a text-classification pipeline:
>>> from transformers import pipeline
>>> text = "Es usted un auténtico impresentable, su señoría."
>>> pipe = pipeline("text-classification", model="Newtral/xlm-r-finetuned-toxic-political-tweets-es")
>>> pipe(text, return_all_scores=True)
[[{'label': 'toxic', 'score': 0.92560875415802},
{'label': 'very toxic', 'score': 0.8310967683792114}]]
The pre-trained model was fine-tuned for sequence classification using the following hyperparameters, which were selected from a validation set:
The optimizer used was AdamW and the loss optimized was binary cross-entropy with class weights proportional to the class imbalance.