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.
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.
1>>> from transformers import pipeline
2>>> text = "Es usted un auténtico impresentable, su señoría."
3>>> pipe = pipeline("text-classification", model="Newtral/xlm-r-finetuned-toxic-political-tweets-es")
4>>> pipe(text, return_all_scores=True)
5
6[[{'label': 'toxic', 'score': 0.92560875415802},
7 {'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.