A Context-Contrastive Inference Approach To Partial Diacritization
Paper · 2024 · Muhammad ElNokrashy and Badr AlKhamissi
Summary
Arabic script usually omits short vowels and gemination, so readers reconstruct pronunciation from context. Most systems restore every possible diacritic (Full Diacritization), yet reading research shows that heavy marking slows skilled readers. The authors treat Partial Diacritization (PD) as a machine learning task and propose Context-Contrastive Partial Diacritization (CCPD). CCPD runs an existing full diacritizer twice on each word: once inside its sentence and once alone. It places a mark only where the two predictions disagree, which points to readings that depend on context. Because no good partially diacritized test sets exist, they define indicators that can be computed from fully diacritized data. They evaluate D2, Shakkelha, Shakkala and a new Transformer model, TD2, on Tashkeela. A behavioral study on WikiNews headlines found that readers frequently had less difficulty with partially marked text than with fully marked text, and in some cases less than with plain text. The method needs no retraining, so any domain-specific diacritizer can produce partial output.
Key points
- CCPD has two variants. The "hard" variant marks a letter when the predictions with and without context differ. The "soft" variants use an adjustable threshold, with examples at 0.1 and 0.01.
- The proposed indicators are:
- SR (Selection Rate);
- B-DER (error of the context-free pass, a proxy for an experienced reader facing bare text);
- Partial DER on the marked subset;
- RE-DER (Reader DER, a weighted mix of contextual error on marked letters and context-free error on unmarked ones);
- SU (Signal Utilization, ranging from −1 to 1).
- TD2, a Transformer variant of the LSTM-based D2, reaches a Partial DER of 5.5 % versus 11.2 % for D2. It also marks more text: 24.6 % versus 6.5 %.
- Reference coverage rates from prior work: professionally published books mark about 1.2 %–9.5 % of letters, while native speakers marking text deliberately reach about 19 %–26 %.
- A public demo is available as a Hugging Face Space (bkhmsi/Partial-Arabic-Diacritization).
Interesting ideas
- I1. Running one model with and without context and treating disagreement as "this decision depends on context" yields an ambiguity detector without any new training data.
- I2. The contrastive trick wraps around any existing predictor rather than replacing it, so it can be added to strong models at almost no cost.
- I3. When gold data for a selective task is missing, the authors build proxy indicators from fully annotated data by splitting errors into a marked part and an unmarked part.
- I4. SU checks whether the added marks actually reduce error compared with leaving those letters bare, which works as a built-in negative control for the value of intervening.
- I5. Stating only the information a reader could not guess from context, tuned by an adjustable threshold, balances clarity against clutter.
For Mova
How these ideas could serve Mova, our small open language model — its files, stages and tests:
- I1 (tokens): tag each word both in its sentence and in isolation, and flag disagreeing POS or lemma choices as context-resolved ambiguities to record in the explanation trace.
- I2 (tree): parse a clause alone and inside the full sentence with gparse or the perceptron parser, and surface arcs that change as attachment decisions driven by wider context.
- I3 (learn): score components that act only on a chosen subset, such as repair rules, separately on touched and untouched items using full gold treebanks.
- I4 (learn): measure whether each self-induced repair rule lowers error on exactly the cases it fires on versus not firing, and drop rules with non-positive utility.
- I5 (back): in generation, make referents or roles explicit only where a context-free reading of the output would resolve them differently than the meaning graph intends.
Institutions
Fields, topics and concepts
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksArts and Humanities · 16,039 worksLanguage and Linguistics · 15,891 works
🧭 Topics 1Research subjects and languages the work is about.Semitic languages · 2,908 works
Cite
Cite as Muhammad ElNokrashy and Badr AlKhamissi. 2024. A Context-Contrastive Inference Approach To Partial Diacritization. Proceedings of the Second Arabic Natural Language Processing Conference.
@inproceedings{elnokrashy2024context,
title = {{A Context-Contrastive Inference Approach To Partial Diacritization}},
author = {Muhammad ElNokrashy and Badr AlKhamissi},
booktitle = {Proceedings of the Second Arabic Natural Language Processing Conference},
year = {2024},
doi = {10.18653/v1/2024.arabicnlp-1.8},
url = {https://doi.org/10.18653/v1/2024.arabicnlp-1.8}
}References
- Hamza Abbad and Shengwu Xiong. 2020. Multi-components system for automatic Arabic diacritization. In Advances in Information Retrieval, pages 341–355, Cham. Springer International Publishing. find
- Aula Abu-Leil, David Share, and Raphiq Ibrahim. 2014. How does speed and accuracy in reading relate to reading comprehension in Arabic? Psicológica, 35:251–276. find
- Abdulmohsen Al-Thubaity, Atheer Alkhalifa, Abdulrahman Almuhareb, and Waleed Alsanie. 2020. Arabic diacritization using bidirectional long short-term memory neural networks with conditional random fields. IEEE Access, 8:154984–154996. ↗
- Badr AlKhamissi, Muhammad ElNokrashy, and Mohamed Gabr. 2020. Deep diacritization: Efficient hierarchical recurrence for improved Arabic diacritization. In Proceedings of the Fifth Arabic Natural Language Processing Workshop, pages 38–48, Barcelona, Spain (Online). Association for Computational Linguistics. ↗
- Manar M Almanea. 2021. Automatic methods and neural networks in Arabic texts diacritization: a comprehensive survey. IEEE Access, 9:145012–145032. ↗
- Rehab Alnefaie and Aqil M. Azmi. 2017. Automatic minimal diacritization of Arabic texts. Procedia Computer Science, 117:169–174. Arabic Computational Linguistics. find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/elnokrashy-2024-context-contrastive-inference-approach-partial/