/ Модель

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

Лицензия
Своя лицензия
Базовая модель
MARBERTv2
Опубликована
29 сен 2026

Tashkeel-v4

Разметка токеновТекст → label

Модель расставляет диакритические знаки в классическом и современном литературном арабском тексте, сохраняя исходные символы.

135скачиваний за 30 дней6лайковвеса обновлены2 окт 2026

Бенчмарки

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

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

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

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

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

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

Tashkeel-v4 — модель для расстановки арабских диакритических знаков, разработанная автором репозитория на основе UBC-NLP/MARBERTv2. Она принимает арабский текст и предсказывает диакритический класс для каждого символа, сохраняя исходные буквы, цифры и пунктуацию. Архитектура включает энкодер MARBERTv2, символьные признаки, двухслойную BiLSTM и линейно-цепную CRF с 15 классами диакритики; размер — около 171 млн параметров.

Модель предназначена для диакритизации классического и современного литературного арабского языка, включая окончания слов, и подходит для пакетной обработки. В README приведены результаты на SadeedDiac-25 и CATT, а также скорость обработки на NVIDIA L40S. Модель особенно полезна там, где важно сохранить текст без изменений; отдельная постобработка ставит касру под хамзой в «إ».

Основные ограничения связаны с редкими и иностранными словами, синтаксической неоднозначностью окончаний и расхождениями в правилах диакритизации хамзат аль-васл. Диалектный арабский и поэзия не были целевыми сценариями. Доступ к весам закрытый до принятия условий, лицензия разрешает только некоммерческое исследовательское использование.

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

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

Ограничения

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

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

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

Открыть на Hugging Face

Tashkeel-v4: Arabic Diacritization (MARBERTv2 + BiLSTM + Linear-Chain CRF)

Research use only. This model is released under a non-commercial, research-only license. Commercial or business use is not permitted. See License.

Tashkeel-v4 adds full diacritics (تشكيل) to Arabic text: Classical and Modern Standard Arabic, including case endings. It is a character tagger: it predicts one diacritic class per input character. So it never adds, drops or changes letters, digits or punctuation (0% hallucination by construction), and it's fast enough for batch processing.

Results

All numbers use the official SadeedDiac-25 evaluator (ArabicDiacritizationEvaluator, gt_missing_diacritic_is_error=False). Total = including case endings; Morph = excluding the last letter. Every sentence is scored (no hallucinations).

BenchmarkTotal DER ↓Morph DER ↓Total WER ↓Morph WER ↓
Misraj/SadeedDiac-25 (1,200 sentences)1.40.965.153.02
Bisher/CATT_benchmark (742 sentences)2.952.2110.377.79

These scores include the built-in إ post-processing step (see below). The package was verified to reproduce them exactly: its predictions match the evaluated checkpoint on every benchmark sentence.

Compared with Tashkeel-v3: SadeedDiac-25 DER 2.26 → 1.4 (−31%), CATT DER 4.98 → 2.95 (−41%).

Throughput (one NVIDIA L40S, diacritize(..., batch_size=64), including Python preprocessing): ~34 sentences/s on SadeedDiac-25 (long, multi-clause sentences) and ~111 sentences/s on CATT (shorter news sentences).

SystemScored sentencesTotal DERTotal WER
Claude-3.7-Sonnet1,190 / 1,2001.394.67
Tashkeel-v4 (this model)1,200 / 1,2001.45.15
Gemini-Flash-2.01,186 / 1,2003.197.99
GPT-41,188 / 1,2003.865.27
Sadeed1,114 / 1,2007.2913.74

Generative LLMs are scored only on the sentences where their output kept the input letters intact. Tashkeel-v4 is close to the strongest LLM result while being far cheaper and faster, and it never alters the input text.

Comparison with the models in the CATT paper

The CATT paper (Alasmary et al., 2024) compares 13 systems on its benchmark. We ran Tashkeel-v4 on the paper's released input file and scored it with the authors' own evaluation script (compute_der.py from abjadai/catt), next to the model outputs the authors released. We checked that the script reproduces the paper's published numbers exactly (e.g. CATT ED: 8.624 / 34.191).

This protocol scores every letter, including letters the reference deliberately leaves unmarked. That's why all numbers here are higher than the CATT row in the Results table above, which uses the SadeedDiac-25 evaluator. CE = with case endings.

ModelCE DER ↓CE WER ↓No-CE DER ↓No-CE WER ↓
Tashkeel-v4 (this model)6.56227.4635.91525.283
CATT Encoder-Decoder (ED)8.62434.1916.98928.477
CATT Encoder-Only (EO)8.76235.5087.08829.714
GPT-4 †9.51538.3118.11333.505
CBHG10.80842.6808.31334.386
Command R+ †13.16948.51811.32944.158
D213.31049.41710.03638.391
Shakkala13.49450.38710.38640.643
Sakhr †13.84156.66111.12547.993
Alkhalil14.23253.41311.56845.777
Mishkal †16.48260.84410.79640.215
Multilevel16.50358.07613.43450.147
Farasa17.82565.78315.41460.114
D358.31398.71048.01895.186

Tashkeel-v4 has the lowest error on all four metrics, with and without case endings. † The CATT script flags sentences whose output text changed (GPT-4: 11, Command R+: 77, Sakhr: 53, Mishkal: 1); Tashkeel-v4: 0. Our training data was checked against the CATT benchmark for 10-word overlap (see Training).

Usage

Access is gated: accept the conditions on this page (logged in to Hugging Face), then authenticate before downloading.

pip install torch transformers
huggingface-cli login   # or set the HF_TOKEN environment variable
import torch
from transformers import AutoModel, AutoTokenizer

model_id = "ahmedsamirtarjama/Tashkeel-v4"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModel.from_pretrained(model_id, trust_remote_code=True)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device).eval()

print(model.diacritize("ذهب الطالب المجتهد إلى المدرسة صباحا", tokenizer=tokenizer, device=device))

texts = ["قل إن صلاتي ونسكي ومحياي ومماتي لله رب العالمين", "سطا لصوص على منزل وزيرة الدفاع التشيلية"]
print(model.diacritize(texts, tokenizer=tokenizer, device=device, batch_size=64))

Input should be undiacritized Arabic text. Characters that aren't Arabic letters pass through unchanged.

Model

  • Encoder: UBC-NLP/MARBERTv2 (12 layers, 768-d). Its token vectors are mapped onto characters.
  • Character features: character, position-in-word and clitic-segment (proclitic / stem / enclitic) embeddings.
  • Sequence layers: 2-layer BiLSTM with a residual projection. Two heads: one for word-internal diacritics, one for case endings on word-final letters.
  • Decoding: linear-chain CRF over 15 diacritic classes (none, fatha, damma, kasra, sukun, the three tanweens, shadda, and shadda combinations). Globally optimal decoding with Viterbi.
  • Post-processing: a bare hamza-below alef (إ) always receives its kasra. This is linguistically always correct, and no other character is modified.
  • Size: ~171M parameters (fp32 weights). Same architecture and code as Tashkeel-v3; only the weights changed.

Training

Tashkeel-v4 continues from Tashkeel-v3 and was trained in stages. In every stage each candidate was compared with a matched control trained for the same number of steps; the final checkpoint of each of 2 seeds was kept and the two were weight-averaged. This rule was fixed in advance, and no checkpoint was ever selected on the benchmark test sets.

  1. In-domain base: Misraj/Sadeed_Tashkeela, replayed in every stage.
  2. Complete classical text: sentences from the Tashkeela corpus (v0.3), Shamela and other public diacritized collections, kept only if fully diacritized (every word-final letter marked, ≤2% unmarked interior letters). Sukun before hamzat al-wasl was normalized to the connecting-vowel convention used by Sadeed_Tashkeela (مِنَ الـ، عَنِ الـ).
  3. Privately collected annotated data: ~114k news and classical sentences, privately collected and diacritized with our in-house annotation pipeline. Outputs were kept only if the letters were unchanged, every word-final letter was marked, and the text passed the same normalization as above.
  4. Model-assisted news labeling: news sentences from arbml/SANAD labeled by earlier versions of the model, kept only where an independent model agreed on ≥97% of words (several rounds, each relabeled by the latest model).
  5. Wikipedia: ~29k Arabic Wikipedia chunks whose own diacritics closely matched the model's.

The continued-training data (stages 2–5, ~1M sentences) is published as ahmedsamirtarjama/Tashkeel-data under the same research-only terms.

Decontamination: every added sentence was checked against SadeedDiac-25, the CATT benchmark and our development set, and any sentence sharing a 10-word sequence with any of them was removed.

Limitations

  • Rare and foreign words are the main remaining error source. Words seen 50 times or fewer in training cause about 33% (SadeedDiac-25) and 37% (CATT) of the errors. That includes transliterated names and brands and uncommon classical vocabulary.
  • Case endings still depend on syntax the model sometimes misreads, for example a fronted object vs. the subject.
  • Conventions: the model writes the connecting vowel before hamzat al-wasl (مِنَ الْ), as in its training data. The SadeedDiac-25 references are inconsistent here (e.g. من is written with sukun in ~30% of wasl contexts, أي and لو in ~95%), which costs ≈0.18 DER. The CATT references also mark the wasl alef itself (اِحْتَفَلَ), which this model doesn't.
  • Scoring note: the official evaluator drops a shadda written after its vowel in a reference, so a few correct predictions count as errors on SadeedDiac-25 (≈0.05 DER).
  • Dialectal Arabic and poetry-specific diacritization weren't targets of this model.

License

Research use only. Tashkeel-v4 (weights and code) is released under the Tashkeel Research-Only License (see LICENSE): use, copying and modification are allowed only for non-commercial research and educational purposes. Commercial or business use of any kind is not permitted. Publications using the model should cite this repository.

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

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

GPU в ailist

Универсальный рантайм

Нельзя запустить

Доступ к модели ограничен автором; у платформы нет доступа к весам.

Ревизия весов
c892459

0 моделей