/ Модель

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

Контекст
512 токенов
Параметры
190 млн
Лицензия
Apache 2.0
Архитектура
bert · dense
Базовая модель
MARBERTv2
Библиотека
transformers
Опубликована
11 июл 2026

HAYAA

Классификация текстаТекст → label3 профессии

HAYAA классифицирует арабские тексты как безопасные или токсичные для помощи в модерации контента.

52скачиваний за 30 дней1лайквеса обновлены28 июл 2026

Бенчмарки

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

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

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

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

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

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

HAYAA — дообученная модель автора youssefreda9 на основе UBC-NLP/MARBERTv2 для бинарной классификации арабского текста по меткам «безопасный» и «токсичный». Она выявляет оскорбления, ненавистнические высказывания, травлю, нецензурную лексику и другие формы токсичного контента в основных арабских диалектах, включая египетский, левантийский, заливный, магрибский, иракский, суданский и литературный арабский.

Модель построена на архитектуре BERT для классификации последовательностей, содержит 190 млн параметров и принимает текст с контекстом до 512 токенов. Она предназначена для модерации соцсетей, форумов и комментариев, а также для инструментов родительского контроля и исследований арабоязычных токсичных высказываний. В README указаны 97,84% точности и F1 94,12% для токсичного класса на тестовом наборе примерно из 100 тысяч предложений; эти показатели относятся к описанной авторами оценке.

HAYAA обучена на публичных арабоязычных наборах данных. Среди ограничений авторы отмечают преобладание данных из Twitter, шум в исходных разметках, неодинаковое представление диалектов, усечение длинных последовательностей и отсутствие учёта диалогового контекста. Модель следует использовать как вспомогательный инструмент с проверкой человеком. Лицензия репозитория — Apache-2.0.

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

  • модерация комментариев на арабском языке
  • поиск оскорблений и ненавистнических высказываний в соцсетях
  • выявление травли и преследования в арабских текстах
  • фильтрация токсичных сообщений в форумах и чатах
  • помощь в родительском контроле арабоязычного контента
  • исследование арабоязычных токсичных высказываний

Ограничения

Данные преимущественно взяты из Twitter, а диалекты представлены неравномерно; возможны ошибки исходной разметки. Модель классифицирует текст отдельно от контекста разговора, длинные последовательности могут усекаться, а результаты требуют проверки человеком.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

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

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

Открыть на Hugging Face

Hayā (حياء) — Arabic Toxic Content Classifier 🛡️

Dataset on HF GitHub

Model Description

Hayā is a fine-tuned UBC-NLP/MARBERTv2 model for binary Arabic toxicity classification (Safe / Toxic). It is designed to detect offensive language, hate speech, cyberbullying, profanity, and other forms of toxic content across all major Arabic dialects.

Hayā is the core classifier in a larger defense-in-depth content moderation system that includes rule-based layers for explicit profanity and a Chrome extension that blurs toxic content in real time.

Key Highlights

  • 🎯 97.84% accuracy on a held-out test set of ~100K sentences
  • 🌍 Every major Arabic dialect: Egyptian, Levantine, Gulf, Maghrebi, Iraqi, Sudanese, MSA
  • 📊 Trained on nearly 1 million examples (997K) from 51 curated public Arabic datasets
  • ⚡ Optimized for real-time inference via serverless API (Modal + FastAPI)
  • 🧠 V2 Update: Enhanced with continued fine-tuning on 34K hard edge-cases to conquer implicit hate and subtle toxicity.

Performance

Evaluated on a held-out test set of 99,759 sentences (stratified, zero data leakage):

MetricScore
Accuracy97.84%
F1 (Toxic)94.12%
F1 (Safe)98.45%

Note on the numbers: Manual error analysis showed the model frequently outperformed the original human annotations — many counted "errors" were actually mislabels in the source datasets. Real-world performance on correctly-labeled data is therefore higher than the raw scores suggest.


Intended Use

Primary Use Cases

  • ✅ Classifying Arabic text as Safe or Toxic
  • ✅ Content moderation for Arabic social media, forums, and comment sections
  • ✅ Child safety and parental control applications
  • ✅ Research on Arabic hate speech and toxicity detection

Out-of-Scope Use

  • ❌ Generating toxic or hateful content
  • ❌ Surveillance or profiling of individuals
  • ❌ Final automated decisions without human review
  • ❌ Non-Arabic text classification

Usage

Quick Start with Transformers Pipeline

from transformers import pipeline

classifier = pipeline("text-classification", model="youssefreda9/HAYAA", top_k=None)

results = classifier("أنت إنسان رائع ومحترم")
print(results)
# [[{'label': 'Safe', 'score': 0.99}, {'label': 'Toxic', 'score': 0.01}]]

results = classifier("يا حمار أنت")
print(results)
# [[{'label': 'Toxic', 'score': 0.98}, {'label': 'Safe', 'score': 0.02}]]

Direct Model Usage

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("youssefreda9/HAYAA")
model = AutoModelForSequenceClassification.from_pretrained("youssefreda9/HAYAA")

text = "كلامك جميل جدا"
inputs = tokenizer(text, return_tensors="pt", max_length=128, truncation=True, padding=True)

with torch.no_grad():
    outputs = model(**inputs)
    probs = torch.softmax(outputs.logits, dim=-1)
    pred = torch.argmax(probs, dim=-1).item()

labels = {0: "Safe", 1: "Toxic"}
print(f"Prediction: {labels[pred]} ({probs[0][pred]:.2%})")

Batch Inference

from transformers import pipeline

classifier = pipeline("text-classification", model="youssefreda9/HAYAA")

texts = [
    "صباح الخير يا أصدقاء",
    "أنت واطي ومحترمش حد",
    "الجو جميل النهارده",
]

results = classifier(texts)
for text, result in zip(texts, results):
    print(f"{result['label']} ({result['score']:.2%}): {text}")

Training Details

Base Model

  • Model: UBC-NLP/MARBERTv2
  • Architecture: BERT-base (Arabic-specific pre-training)
  • Task: Binary sequence classification (Safe / Toxic)

Training Data

  • Dataset: youssefreda9/HAYAA
  • Training examples: ~798K
  • Validation examples: ~100K
  • Sources: 51 curated public Arabic hate-speech and abuse datasets
  • Dialects: All major Arabic dialects + MSA

Hyperparameters

ParameterValue
Max sequence length128
Training Strategy2-Stage (4 epochs base corpus + 3 epochs hard edge-cases)
Batch size16 (effective: 32 with gradient accumulation)
Learning rate2e-5 (Stage 1), 5e-6 (Stage 2)
Warmup ratio0.1
Weight decay0.01
FP16✅
LossWeighted cross-entropy (class imbalance)
Best model metricF1 (weighted)
OptimizerAdamW
Seed42

Class Weighting

The training set is imbalanced (more Safe than Toxic). A weighted cross-entropy loss was used, with the Toxic class weight dynamically computed as safe_count / toxic_count to ensure the model doesn't under-predict toxicity.


What It Detects

The Toxic label covers:

CategoryExamples
ProfanityExplicit swear words across all dialects
Hate speechIncitement against groups based on religion, ethnicity, nationality
CyberbullyingPersonal insults, harassment, directed attacks
RacismRacial slurs and discriminatory language
SexismMisogynistic and sexually explicit language
Religious hateBlasphemy, sectarian attacks
Obfuscated toxicityIntentional typos, spaced letters, homoglyphs

Dialects

DialectCoverage
Egyptian✅
Levantine (Syrian, Lebanese, Jordanian, Palestinian)✅
Gulf (Saudi, Emirati, Kuwaiti, Bahraini, Omani, Qatari)✅
Maghrebi (Moroccan, Algerian, Tunisian, Libyan)✅
Iraqi✅
Sudanese✅
Modern Standard Arabic (MSA)✅

Part of a Larger System

This model is one layer in the Hayā defense-in-depth pipeline:

LayerFunction
L0 — SanitizeUnicode normalization, homoglyph folding, emoji analysis
L1 — DictionaryContext-aware instant matching (100% precision)
L1.5 — De-obfuscationResolves masked/spaced evasion attempts
L2 — This ModelDeep-learning classification for implicit toxicity

The full pipeline ships as a Chrome Extension (Manifest V3) with PIN-protected parental controls. See the GitHub repository for the complete system.


Limitations & Biases

  • Platform bias: Training data is predominantly from Twitter; performance may vary on other platforms (forums, messaging apps, gaming chat).
  • Annotation noise: Despite extensive cleaning, some label noise from the 51 original source datasets may persist.
  • Dialect imbalance: Egyptian and MSA are better represented than Sudanese or Yemeni dialects.
  • Max length: Sequences longer than 128 tokens are truncated, which may affect classification of very long texts.
  • Evolving language: Arabic internet slang and evasion tactics evolve constantly; periodic retraining is recommended.
  • Context limitations: The model classifies individual texts in isolation; conversational context is not considered.

Ethical Considerations

  • This model is designed to protect people — especially children — from online abuse.
  • It should be used as a tool to assist human moderators, not as a sole decision-maker.
  • False positives (Safe text flagged as Toxic) can suppress legitimate speech; false negatives (Toxic text missed) can leave users exposed to harm.
  • The model was trained on publicly available datasets with appropriate licenses.

Citation

@misc{hayaa2026,
  title={Hayā: Fine-tuned MARBERTv2 for Multi-Dialect Arabic Toxicity Classification},
  author={Youssef Reda},
  year={2026},
  url={https://huggingface.co/youssefreda9/HAYAA},
}

License

This model is released under the Apache 2.0 License.


Links

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей