/ Модель

Характеристики

Контекст
512 токенов
Параметры
175 млн
Лицензия
CC BY-NC 4.0
Архитектура
bert · dense
Базовая модель
DarijaBERT
Библиотека
transformers
Опубликована
7 июл 2026

DarijaToxicityDetector

Классификация текстаТекст → label

BERT-классификатор для выявления токсичных и оскорбительных сообщений на марокканском диалекте дарижа.

14скачиваний за 30 дней0лайковвеса обновлены7 июл 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

DarijaToxicityDetector — BERT-классификатор последовательностей, разработанный Hicham Assoudi из Typica.ai для бинарного выявления оскорбительного и токсичного контента на марокканском арабском диалекте дарижа. Модель дообучена на SI2M-Lab/DarijaBERT; содержит 174,7 млн параметров, принимает текст на арабском письме и имеет контекст до 512 токенов. Она относит сообщения к классам «чистое» и «оскорбительное», включая культурно обусловленные оскорбления и агрессию, и предназначена для исследований, обучения, сравнительной оценки систем модерации и прототипирования фильтров для комментариев, форумов и соцсетей.

В README приведена оценка F1 около 0,83 на тестовой выборке из датасета OMCD_Typica.ai_Mix, однако результат зависит от данных и не гарантирует аналогичного качества в реальном потоке. Модель хуже подходит для сарказма, текста преимущественно на латинице, Arabizi, французском или английском, а также для других арабских диалектов и литературного арабского. Рекомендуется проверка человеком; полностью автоматические решения о модерации не рекомендуются. Лицензия CC-BY-NC-4.0 допускает некоммерческое использование с указанием авторства, а коммерческое использование требует отдельного соглашения с Typica.ai.

Сценарии применения

  • Поиск оскорблений в комментариях на марокканском дарижа
  • Предварительная модерация сообщений в марокканских соцсетях и форумах
  • Разметка токсичных и нейтральных высказываний для анализа
  • Сравнение качества систем модерации арабских диалектов
  • Обучение и прототипирование NLP-моделей для низкоресурсных языков

Ограничения

Модель ориентирована на дарижу в арабском письме: качество для Arabizi, латиницы, французского, английского, других арабских диалектов и литературного арабского не гарантируется. Возможны ошибки на сарказме и из-за субъективности разметки; результаты следует проверять человеком, а язык токсичных высказываний может со временем меняться.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

DarijaToxicityDetector — Moroccan Darija Toxicity Detection (Binary)

DarijaToxicityDetector is a BERT-based binary text classifier that detects toxic / offensive content in Moroccan Darija (Moroccan Arabic dialect, written in Arabic script). It is fine-tuned from SI2M-Lab/DarijaBERT on the OMCD_Typica.ai_Mix dataset, a curated blend of the public OMCD dataset and Typica.ai's proprietary culturally grounded annotations.

The model is released by Typica.ai as part of its applied research on culturally localized AI for underserved languages, and is open-sourced for educational and research purposes.

📄 Companion paper: A Comparative Benchmark of a Moroccan Darija Toxicity Detection Model (Typica.ai) and Major LLM-Based Moderation APIs (OpenAI, Mistral, Anthropic) — the benchmark shows that this culturally adapted model outperforms general-purpose LLM moderation APIs on Moroccan Darija toxicity detection.

Model Details

Developed byHicham Assoudi — Typica.ai
Model typeBERT-based sequence classification (binary)
LanguageMoroccan Darija (ary), Arabic script
Base modelSI2M-Lab/DarijaBERT
LicenseCC BY-NC 4.0 (non-commercial — education & research)
PaperarXiv:2505.04640
Contactassoudi@typica.ai

Labels

idlabelmeaning
0cleanNon-toxic content
1offensiveToxic content (insults, hate, obscenity, culturally embedded aggression)

Intended Uses

Direct intended uses:

  • Research on toxicity detection and content moderation for low-resource languages and Arabic dialects.
  • Education: teaching NLP fine-tuning, evaluation, and culturally adapted model design.
  • Benchmarking against general-purpose moderation systems (see companion paper).
  • Prototyping moderation pipelines for Moroccan Darija user-generated content (comments, social media, forums).

Out-of-scope uses:

  • ❌ Commercial deployment without a separate agreement with Typica.ai (license is non-commercial).
  • ❌ Fully automated moderation decisions without human review — the model produces errors, especially on sarcasm.
  • ❌ Text dominated by Latin script (Arabizi, French, English): such content was filtered out of training data.
  • ❌ Other Arabic dialects or MSA — performance is not guaranteed outside Moroccan Darija.

How to Use

from transformers import pipeline

classifier = pipeline(
    "text-classification",
    model="TypicaAI/DarijaToxicityDetector",
)

texts = [
    "هاد الفيديو ما عجبنيش بزاف", # expected: clean
    "مول هاد الفيديو باسل وما مربّيش", # expected: offensive
    "هاد الإنفلونسر مكلّخ غير كيخربق" # expected: offensive
]
print(classifier(texts, truncation=True, max_length=512))
# [{'label': 'clean', 'score': ...}, {'label': 'offensive', 'score': ...}]

Training Data: OMCD_Typica.ai_Mix

The model was trained on OMCD_Typica.ai_Mix (12,758 Moroccan Darija comments), built as follows:

  • Backbone: OMCD — Offensive Moroccan Comments Dataset (Essefar et al., 2023), a widely cited, well-annotated public resource for Darija toxicity research.
  • Enrichment: Typica.ai proprietary annotations covering culturally embedded toxicity — indirect insults, sarcasm, euphemisms, and culturally specific aggression that general-purpose models frequently miss.
  • Preprocessing: sentences with >50% Latin-script characters were removed (to exclude French/English/Arabizi-dominated code-switching); Latin characters, symbols, and punctuation were cleaned while preserving linguistic meaning.
  • Balancing: random undersampling of the majority (clean) class to reach a 1:1 clean/offensive ratio, preventing majority-class bias.

Splits

SplitExamplesUsed for
Train9,568Fine-tuning
Validation2,552Best-checkpoint selection
Test638Final evaluation & paper benchmark

Each example carries sentence, label (ClassLabel: clean/offensive), idx, and origin (source provenance) fields.

The test split is publicly available for reproducibility in the benchmark GitHub repository. The proprietary training annotations are not released.

Training Procedure

  • Base checkpoint: SI2M-Lab/DarijaBERT
  • Objective: binary sequence classification (cross-entropy)
  • Tokenization: DarijaBERT tokenizer, truncation at max_length=512, dynamic padding (DataCollatorWithPadding)

Hyperparameters:

HyperparameterValue
Learning rate2e-5
Train batch size16
Eval batch size8
Epochs10
Weight decay0.01
Eval/save strategyper epoch, best model restored at end

Evaluation

Held-out test set (638 examples, balanced)

MetricScore
Accuracy0.8307
Weighted F10.8308

Benchmark vs. commercial moderation APIs

Original benchmark — from the companion paper (May 2025), on the OMCD_Typica.ai_Mix test split (n = 630):

ModelAccuracyMacro F1Toxic F1Not-Toxic F1
Typica.ai (this line of models)0.8300.8300.8340.827
OpenAI (omni-moderation-latest)0.6520.6440.5890.699
Mistral (mistral-moderation-latest)0.6490.6410.5880.694
Anthropic Claude (claude-3-haiku-20240307)0.6590.6170.7430.492

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):

ModelPrecisionRecallF1-score
Typica.ai (custom BERT-based model)0.8320.8300.830
Anthropic Claude (claude-haiku-4-5-20251001)0.6950.6570.646
OpenAI (omni-moderation-latest)0.6920.6300.607
Mistral (mistral-moderation-latest)0.6330.5920.571

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.

Limitations & Bias

  • Cross-dialectal noise: source data may include some non-Moroccan Arabic dialect examples.
  • Annotation subjectivity: toxicity is culturally shaped; annotator judgment introduces some variance.
  • Sarcasm false positives: highly sarcastic but benign messages can be flagged as offensive.
  • Script coverage: Arabic script only; Arabizi/Latin-script Darija is out of scope.
  • Temporal drift: online toxic language evolves; periodic re-training is recommended.

Ethical Considerations

This model deals with offensive content by design. It should support — not replace — human moderation. Misclassification can silence legitimate speech (false positives) or expose users to harm (false negatives). Deployers should implement human-in-the-loop review, appeal mechanisms, and threshold calibration appropriate to their community norms.

Citation

If you use this model, please cite:

@article{assoudi2025comparative,
  title   = {A Comparative Benchmark of a Moroccan Darija Toxicity Detection Model (Typica.ai) and Major LLM-Based Moderation APIs (OpenAI, Mistral, Anthropic)},
  author  = {Assoudi, Hicham},
  journal = {arXiv preprint arXiv:2505.04640},
  year    = {2025},
  url     = {https://arxiv.org/abs/2505.04640}
}

Contact

Hicham Assoudi — Founder & Applied AI Researcher, Typica.ai · PhD (AI/NLP) Typica.ai — Independent applied research initiative 📧 assoudi@typica.ai · Linkedin . 🌐 typica.ai · 🤗 TypicaAI on Hugging Face

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
BertForSequenceClassification
Ревизия весов
111d19a

0 моделей