Computational Arabic morphology: analysis and disambiguation

Computational Arabic Morphology: Analysis and Disambiguation

The non-concatenative structure of the Arabic word (root, pattern and affixes), the difference between morphological analysis (generating all possible analyses) and morphological disambiguation (choosing the correct analysis in context), with an explanation of the Buckwalter analyzer, the MADAMIRA, CAMeL Tools and Farasa tools, and deep-learning methods.

Lesson 8 of 38Intermediate40 minutes

Lesson objectives

  • Describe the components of the Arabic word and the features of morphological analysis (gender, number, person, case, aspect…).
  • Distinguish between the morphological analyzer and the disambiguator.
  • Know the main Arabic tools and their outputs.
Page contents
  1. The structure of the Arabic word
  2. Features of morphological analysis
  3. Stage one: out-of-context analysis
  4. Stage two: in-context disambiguation
  5. Why does morphology matter even with transformers?
  6. Evaluation metrics

The structure of the Arabic word

A written Arabic word is made of layers:

  1. Proclitics: the interrogative particle “أ”, the conjunctions “و، ف”, prepositions and similar particles “ب، ل، ك”, the future particle “س”, and the definite article “ال”.
  2. The stem, produced by interdigitating (Interdigitation) the root into the pattern: the root “ع ل م” with the pattern “مُفَعِّل” → “مُعَلِّم”. This is the essence of non-concatenative (templatic) morphology (Non-concatenative / Templatic Morphology).
  3. Inflectional affixes: markers of the imperfective, plural, feminine and dual: “يَـ…ـونَ”, “ـات”, “ـان”.
  4. Enclitics: attached pronouns “ـه, ـها, ـهم, ـكم, ـنا”.

Example: «وسيعلّمونها» = و (conjunction) + س (future) + يُعَلِّمُ (stem from the root ع-ل-م on the pattern يُفَعِّل) + ون (masculine plural) + ها (object pronoun).

Broken plurals make things harder: “كُتُب” is the plural of “كِتاب”, and “رجال” the plural of “رجل”; the singular cannot be recovered by removing a suffix.

Features of morphological analysis

Full morphological analysis of a word is not limited to segmenting it; it specifies feature values (Features):

FeatureValuesExample «يُعَلِّمونها»
Part of speechNoun, verb, particle…Verb
Aspect/tensePerfective, imperfective, imperativeImperfective
Person1, 2, 33 (third person)
GenderMasculine, feminineMasculine
NumberSingular, dual, pluralPlural
VoiceActive, passiveActive
Case/moodNominative/indicative, accusative/subjunctive, jussive…Indicative
Attached pronounIts type, person and numberها: third person feminine singular
Lemma and rootLemma: عَلَّمَ, root: ع-ل-م

The analysis is usually written in a scheme such as the Buckwalter scheme, the PATB tag scheme or the CAMeL scheme.

Stage one: out-of-context analysis

A morphological analyzer takes a single word and returns all possible analyses. The best-known example is the Buckwalter analyzer (BAMA), which relies on three lexicons (prefixes, stems, suffixes) and three compatibility tables that determine which prefix is compatible with which stem and which suffix. The analyzer segments the word in every possible way and accepts the segmentations whose components are compatible.

For the undiacritized word «كتب», for example, the analyses include: كَتَبَ (active perfective verb), كُتِبَ (passive), كُتُب (plural of كتاب), and كَتَّبَ (doubled verb). Many Arabic words have more than ten analyses when all feature values are counted.

Stage two: in-context disambiguation

Morphological disambiguation picks the correct analysis by looking at the context. Three generations of methods have appeared:

  1. MADA, then MADAMIRA (Habash & Rambow 2005; Pasha et al. 2014): train classifiers (SVMs and language models) that predict each feature separately from the context, then rank the analyzer's analyses by how well they agree with the predictions, and pick the highest. MADAMIRA combines MADA for MSA with AMIRA for segmentation, and supports Egyptian Arabic.
  2. Farasa (Abdelali et al., 2016): focuses on segmentation at very high speed, using a ranking classifier (SVM-rank) with light features, and achieved segmentation performance close to MADAMIRA at much higher speed.
  3. Neural models: BiLSTM networks, then pretrained models (such as CAMeLBERT) fine-tuned to predict features or the full analysis. CAMeL Tools (Obeid et al., 2020) provides an open-source Python framework that combines an analyzer based on a morphological database with statistical and neural disambiguators, and supports MSA and several dialects.

Why does morphology matter even with transformers?

  • Pre-segmentation before the subword tokenizer improved models such as AraBERT on some tasks because it reduces splitting words into arbitrary pieces.
  • Morphological tasks themselves (diacritization, spelling correction, Arabic teaching, dictionary search) need accurate, interpretable analysis.
  • Scarce resources for dialects: analyzers can be adapted with rules where there is not enough data to train a model.
  • Evaluation: many errors of large models in Arabic are morphological (gender and number agreement, attached pronouns).

Evaluation metrics

  • Segmentation accuracy at the word level.
  • Per-feature accuracy (POS, gender, number…) and full-analysis accuracy (All-tags accuracy).
  • Lemma accuracy and diacritization accuracy when the analysis includes full diacritization.

Try it: in the Morphology module, type “وسيعلمونها فبكتابهم والمعلمات” and look at the possible segmentations the lab suggests, then think: which one is correct in the sentence “والمعلمات سيعلمونها”? This is exactly what the disambiguation stage does.

Lesson summary

  • Arabic word = proclitics + (root × pattern) + inflectional affixes + enclitics.
  • The analyzer generates all possible analyses out of context, and the disambiguator picks one using the context.
  • Modern tools combine a morphological database with statistical or neural models.

Check what you understood

Choose an answer for each question to see the correction and the reasoning. Your answers are not sent anywhere.

  1. What is the difference between a morphological analyzer and a disambiguator?

  2. Why is Arabic morphology described as non-concatenative?

References

  1. Habash, N. (2010). Introduction to Arabic Natural Language Processing. Morgan & Claypool doi.org/10.2200/S00277ED1V01Y201008HLT010
  2. Buckwalter, T. (2004). Buckwalter Arabic Morphological Analyzer Version 2.0. LDC2004L02 catalog.ldc.upenn.edu/LDC2004L02
  3. Pasha, A. et al. (2014). MADAMIRA: A Fast, Comprehensive Tool for Morphological Analysis and Disambiguation of Arabic. LREC lrec-conf.org/proceedings/lrec2014/pdf/593_Paper.pdf
  4. Obeid, O. et al. (2020). CAMeL Tools: An Open Source Python Toolkit for Arabic Natural Language Processing. LREC aclanthology.org/2020.lrec-1.868/
  5. Abdelali, A., Darwish, K., Durrani, N. & Mubarak, H. (2016). Farasa: A Fast and Furious Segmenter for Arabic. NAACL Demos aclanthology.org/N16-3003/