Downloads · 30 days
11
9% of all-time downloads
delarosajav95/HateSpeech-BETO-cased-v1
HateSpeech-BETO-cased-v1 is a text classification model from delarosajav95. Use it when you need a label for a piece of text. It is set up for transformers.
A newer, enhanced version of this model is now available: HateSpeech-BETO-cased-v2. This updated version offers significantly improved performance, addressing real-world challenges with greater accuracy and reliability.
Downloads · 30 days
11
9% of all-time downloads
All-time downloads
118
Public
Parameters
110M
5.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt3.5 GB · 61%
From the Hugging Face model README
A newer, enhanced version of this model is now available: HateSpeech-BETO-cased-v2. This updated version offers significantly improved performance, addressing real-world challenges with greater accuracy and reliability.
We strongly recommend using this other second fine-tuned version, which has been specifically optimized to better detect nuanced forms of hate speech in Spanish. Explore the improved model here: 👉 HateSpeech-BETO-cased-v2.
This model is a fine-tuned version of dccuchile/bert-base-spanish-wwm-cased for hate speech detection related to racism, homophobia, sexism, and other forms of discrimination in Spanish text. It is trained on the dataset Paul/hatecheck-spanish.
The text classification task in this model is based on 2 sentiment labels: hateful and non-hateful.
from transformers import pipeline
pipe = pipeline(model="delarosajav95/HateSpeech-BETO-cased-v1")
inputs = ["El camarero a cargo del bar era demasiado afeminado, se notaba que la manera de moverse no era la propia de un hombre.",
"La manera en que me miraba tan desagradable era porque era una persona del sur.",
"Estoy cansado de que las mujeres se pongan falda y vayan provocando por ahí a toda persona normal y corriente."
]
result = pipe(inputs, return_all_scores=True)
label_mapping = {"LABEL_0": "Hateful", "LABEL_1": "Non-hateful"}
for i, predictions in enumerate(result):
print("==================================")
print(f"Text {i + 1}: {inputs[i]}")
for pred in predictions:
label = label_mapping.get(pred['label'], pred['label'])
score = pred['score']
print(f"{label}: {score:.2%}")
Output:
==================================
Text 1: El camarero a cargo del bar era demasiado afeminado, se notaba que la manera de moverse no era la propia de un hombre.
Hateful: 99.98%
Non-hateful: 0.02%
==================================
Text 2: La manera en que me miraba tan desagradable era porque era una persona del sur.
Hateful: 99.98%
Non-hateful: 0.02%
==================================
Text 3: Estoy cansado de que las mujeres se pongan falda y vayan provocando por ahí a toda persona normal y corriente.
Hateful: 99.84%
Non-hateful: 0.16%
It achieves the following results on the evaluation set (last epoch):
It achieves the following results on the test set:
@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}
}