Text Classification
Transformers
Safetensors
Moroccan Arabic
Arabic
bert
toxicity-detection
content-moderation
offensive-language
moroccan-darija
darija
low-resource-languages
Eval Results (legacy)
text-embeddings-inference
Instructions to use TypicaAI/DarijaToxicityDetector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TypicaAI/DarijaToxicityDetector with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="TypicaAI/DarijaToxicityDetector")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("TypicaAI/DarijaToxicityDetector") model = AutoModelForSequenceClassification.from_pretrained("TypicaAI/DarijaToxicityDetector") - Notebooks
- Google Colab
- Kaggle
Update model card: add July 2026 benchmark re-run (claude-haiku-4-5, omni-moderation, mistral-moderation)
Browse files
README.md
CHANGED
|
@@ -154,7 +154,7 @@ Each example carries `sentence`, `label` (ClassLabel: `clean`/`offensive`), `idx
|
|
| 154 |
|
| 155 |
### Benchmark vs. commercial moderation APIs
|
| 156 |
|
| 157 |
-
|
| 158 |
|
| 159 |
| Model | Accuracy | Macro F1 | Toxic F1 | Not-Toxic F1 |
|
| 160 |
|---|---:|---:|---:|---:|
|
|
@@ -163,7 +163,16 @@ From the [companion paper](https://arxiv.org/abs/2505.04640), on the same OMCD_T
|
|
| 163 |
| Mistral (mistral-moderation-latest) | 0.649 | 0.641 | 0.588 | 0.694 |
|
| 164 |
| Anthropic Claude (claude-3-haiku-20240307) | 0.659 | 0.617 | 0.743 | 0.492 |
|
| 165 |
|
| 166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
|
| 168 |
## Limitations & Bias
|
| 169 |
|
|
@@ -191,21 +200,6 @@ If you use this model, please cite:
|
|
| 191 |
}
|
| 192 |
```
|
| 193 |
|
| 194 |
-
Please also cite the OMCD dataset the training data builds upon:
|
| 195 |
-
|
| 196 |
-
```bibtex
|
| 197 |
-
@article{essefar2023omcd,
|
| 198 |
-
title = {OMCD: Offensive Moroccan Comments Dataset},
|
| 199 |
-
author = {Essefar, Kabil and Ait Baha, Hassan and El Mahdaouy, Abdelkader and El Mekki, Abdellah and Berrada, Ismail},
|
| 200 |
-
journal = {Language Resources and Evaluation},
|
| 201 |
-
volume = {57},
|
| 202 |
-
number = {4},
|
| 203 |
-
pages = {1745--1765},
|
| 204 |
-
year = {2023},
|
| 205 |
-
doi = {10.1007/s10579-023-09663-2}
|
| 206 |
-
}
|
| 207 |
-
```
|
| 208 |
-
|
| 209 |
## Contact
|
| 210 |
|
| 211 |
**Hicham Assoudi** — Founder & Applied AI Researcher, Typica.ai · PhD (AI/NLP)
|
|
|
|
| 154 |
|
| 155 |
### Benchmark vs. commercial moderation APIs
|
| 156 |
|
| 157 |
+
**Original benchmark** — from the [companion paper](https://arxiv.org/abs/2505.04640) (May 2025), on the OMCD_Typica.ai_Mix test split (n = 630):
|
| 158 |
|
| 159 |
| Model | Accuracy | Macro F1 | Toxic F1 | Not-Toxic F1 |
|
| 160 |
|---|---:|---:|---:|---:|
|
|
|
|
| 163 |
| Mistral (mistral-moderation-latest) | 0.649 | 0.641 | 0.588 | 0.694 |
|
| 164 |
| Anthropic Claude (claude-3-haiku-20240307) | 0.659 | 0.617 | 0.743 | 0.492 |
|
| 165 |
|
| 166 |
+
**Updated re-run** — July 2026, same gold test set (n = 630, balanced), same inputs to all APIs, using each provider's then-current moderation endpoint (weighted precision / recall / F1):
|
| 167 |
+
|
| 168 |
+
| Model | Precision | Recall | F1-score |
|
| 169 |
+
|---|---:|---:|---:|
|
| 170 |
+
| **Typica.ai (custom BERT-based model)** | **0.832** | **0.830** | **0.830** |
|
| 171 |
+
| Anthropic Claude (claude-haiku-4-5-20251001) | 0.695 | 0.657 | 0.646 |
|
| 172 |
+
| OpenAI (omni-moderation-latest) | 0.692 | 0.630 | 0.607 |
|
| 173 |
+
| Mistral (mistral-moderation-latest) | 0.633 | 0.592 | 0.571 |
|
| 174 |
+
|
| 175 |
+
Fourteen months after the original benchmark, the performance gap persists even against newer commercial models: the culturally adapted classifier still leads by ~18+ F1 points. General-purpose APIs continue to miss culturally nuanced toxicity (indirect insults, sarcasm, cultural idioms), while the specialized model maintains the best balance between catching toxic content and avoiding false positives.
|
| 176 |
|
| 177 |
## Limitations & Bias
|
| 178 |
|
|
|
|
| 200 |
}
|
| 201 |
```
|
| 202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
## Contact
|
| 204 |
|
| 205 |
**Hicham Assoudi** — Founder & Applied AI Researcher, Typica.ai · PhD (AI/NLP)
|