Views
No views yet
hate or not hate) with a probability score for further analysis.| Source Dataset | Language(s) | Description |
|---|---|---|
manueltonneau/spanish-hate-speech-superset | Spanish 🇪🇸 | Aggregated Spanish hate speech datasets. |
manueltonneau/english-hate-speech-superset | English 🇬🇧 | Extensive superset with over 300k samples from English corpora. |
manueltonneau/french-hate-speech-superset | French 🇫🇷 | Curated superset from multiple French datasets. |
HateCheck | English (original) + Spanish + French 🌐 | Translated into Spanish and French to test multilingual generalization and error cases. |
Custom Bias Correction Dataset | Multilingual 🌍 | Designed to mitigate gender, racial, and cultural bias in predictions. |
🧩 The final dataset consists of ~60,000 balanced samples, with comparable representation across Spanish, English, and French, ensuring no language dominates the training phase.
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch.nn.functional as F
3import torch
4
5model = AutoModelForSequenceClassification.from_pretrained("WhiterBB/multilingual-hatespeech-detection")
6tokenizer = AutoTokenizer.from_pretrained("WhiterBB/multilingual-hatespeech-detection")
7
8text = "Je déteste cette personne"
9inputs = tokenizer(text, return_tensors="pt")
10with torch.no_grad():
11 logits = model(**inputs).logits
12 probs = F.softmax(logits, dim=-1)
13 predicted_class = torch.argmax(probs).item()
14 confidence = probs[0][predicted_class].item()
15
16label = "Hate" if predicted_class == 1 else "Not Hate"
17print(f"{label} ({confidence:.2%})")| Class | Precision | Recall | F1-score | Support |
|---|---|---|---|---|
| Not Hate | 0.85 | 0.83 | 0.84 | 30,352 |
| Hate | 0.81 | 0.83 | 0.82 | 26,609 |