Elamur Research
☰
home / papers / 2014 / MADAMIRA: A Fast, Comprehensive Tool for Morphological Analysis and Disambiguation of Arabic

MADAMIRA: A Fast, Comprehensive Tool for Morphological Analysis and Disambiguation of Arabic

What it is about

MADAMIRA merges two older Arabic tools, MADA (morphology and disambiguation) and AMIRA (tokenization, tagging, chunking), into one Java system. The pipeline is: preprocessing, a list of all analyses per word from SAMA (MSA) or CALIMA (Egyptian), feature prediction by linear SVMs (closed-class features) and language models (lemma and diacritics), ranking of the analyses by agreement with those predictions, then tokenization in 11 schemes, base-phrase chunking and named-entity tags. It runs as a stand-alone tool or as a server. On blind test sets of about 25K MSA words and 20K Egyptian words, its full-match accuracy is within 0.2 points of MADA for MSA (84.1 against 84.3) and within 0.6 for Egyptian. The paper reports speed-ups of 16 to 21 times for MSA and 14 to 19 times for Egyptian, against the older tools. The licence is non-commercial research only.

Ideas

For Mova

I1 goes into tools/hbo (the segmenter output) and languages/hbo/13-mova-tools.md. I2 goes into the explain output of tools/hbo and the ranking step of gparse use. I3 is the evaluation table for tools/hbo, with the scores kept in the repository's test notes. The tool itself is research-only, so no code or model is taken from it.

Library summary

The Research library's own summary of the paper, in our words — not the paper's text.

Written for the Research library (claude-opus-5-5) from the paper text, in our own words: the license "CC BY-NC 4.0 (ELRA, LREC proceedings)" does not allow redistributing the text itself. Original — aclanthology.org/L14-1479.pdf

Summary

Arabic is hard for NLP. Its words carry many clitics and inflections, its script usually omits diacritics, and spoken dialects differ substantially from Modern Standard Arabic (MSA). Before this work, two Perl-based research prototypes were widely used: MADA, which ranks analyses from a morphological analyzer using SVMs and language models, and AMIRA, which handles tokenization, POS tagging, base phrase chunking and NER through surface-level classifiers. Both were slow, fragile and required separately installed third-party tools.

The authors rebuilt the MADA pipeline in Java and added AMIRA's chunking and named-entity components, producing MADAMIRA. It replaces the external dependencies with a bundled LIBLINEAR and a new interface tool called COGENT. It also adds XML/HTTP input and output and a persistent server mode. Models were trained on the Penn Arabic Treebank (MSA) and the Egyptian Arabic Treebanks (EGY).

Accuracy is nearly the same as its predecessors, with losses no larger than 0.6% absolute. The system runs more than an order of magnitude faster, which makes it practical as a preprocessing step for larger applications such as machine translation.

Key points

  • Pipeline: the system runs these steps in order:
    • a preprocessor converts text to Buckwalter transliteration;
    • a morphological analyzer produces context-free analyses (SAMA for MSA, CALIMA-ARZ for EGY);
    • linear SVMs handle features drawn from a small, fixed set of values, and language models handle those with an unbounded vocabulary, such as lemma and diacritized form;
    • each analysis is scored by its agreement with these predictions;
    • optional final stages perform tokenization, base phrase chunking and NER.
  • Accuracy vs. predecessors (Table 3):
    • MSA: MADAMIRA reaches 86.3% full diacritization, 96.0% lemma and 95.9% POS accuracy, against 86.4 / 96.2 / 96.1 for MADA v3.2.
    • EGY: MADAMIRA's POS accuracy rises to 92.4% from 91.8% for MADA-ARZ.
    • Tokenization improves slightly for both varieties (MSA ATB tokenization 98.9 vs 98.8).
  • Speed:
    • MSA: 420 words/sec in stand-alone mode and about 1013 words/sec in server-client mode, versus 48.8 for MADA (16–21x faster).
    • EGY: 389 and 844 words/sec, versus 44.9 for MADA-ARZ (14–19x faster).
  • Tokenization options: 11 schemes are available (D1, D2, D3, ATB, ATB4MT, D34MT, and others). Some are multi-form, outputting lemma and CATiB, Penn ATB or Buckwalter POS tags. EGY supports only the heuristic BWFORM variants.
  • Memory and comparison with AMIRA:
    • Loading all models takes about 2.5GB of Java heap; a single-dialect mode needs 1.5GB.
    • AMIRA, for comparison, tokenizes MSA test data with 91.4% accuracy at 49.9 words/sec.

Interesting ideas

  • Analyze, then rank: an analyzer lists every possible reading of a word, classifiers predict individual features, and a weighted agreement score selects the best reading. The output therefore always comes from the analyzer's inventory, which keeps it linguistically consistent. This design suits any morphologically rich language with an existing analyzer, such as Ukrainian.
  • Different models for different feature types: cheap linear classifiers handle features with few possible values, while language models handle open-vocabulary features like lemmas. Matching the model type to the size of the label space keeps the system both fast and accurate.
  • Tokenization chosen after disambiguation: many tokenization schemes are generated from the single chosen analysis, so each user picks the segmentation that fits their task (MT, parsing, evaluation) without retraining. This is worth copying for pipelines that serve several downstream consumers.
  • Server mode with priming: models stay loaded in a long-running process, and benchmarks are measured only after warming the server with a tiny input. This separates load time from real throughput and makes speed comparisons fair.
  • Early exit from the pipeline: users can request only the outputs they need, and the pipeline stops at the corresponding stage, for example returning the unranked analysis list without running any models. This saves compute and turns one tool into a set of smaller services.

Cite

The paper itself, not this card. BibTeX from the library's record of the work. DOI 10.63317/3piegahzyagx

@inproceedings{pasha2014madamira,
  title = {{MADAMIRA: A Fast, Comprehensive Tool for Morphological Analysis and Disambiguation of Arabic}},
  author = {Pasha, Arfath and Al-Badrashiny, Mohamed and Diab, Mona and Kholy, Ahmed El and Eskander, Ramy and Habash, Nizar and Pooleery, Manoj and Rambow, Owen and Roth, Ryan},
  booktitle = {Proceedings of the Ninth International Conference on Language Resources and Evaluation (LREC'14)},
  year = {2014},
  doi = {10.63317/3piegahzyagx},
  url = {https://doi.org/10.63317/3piegahzyagx}
}

References

10 references, 2 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. Al-Sabbagh, R. and Girju, R. (2012). A supervised POS tagger for written Arabic social networking corpora. In EGY MADA-ARZ MADAMIRA v0.4 v1.0 83.8 83.2 87.8 87.8 91.8 92.4 77.5 77.3 98.9 99.2 96.6 97.6 96.5 97.4 420.2 1013.4 44.9 – 389.1 844.1 find
  2. Jancsary, J., editor, Proceedings of KONVENS 2012, pages 39–52. ÖGAI, September. Main track: oral presentations. find
  3. Buckwalter, T. (2004). Buckwalter Arabic Morphological Analyzer Version 2.0. LDC catalog number LDC2004L02, ISBN 1-58563-324-0. find
  4. Buckwalter, T. (2007). Issues in Arabic Morphological Analysis. In van den Bosch, A. and Soudi, A., editors, Arabic Computational Morphology: Knowledge-based and Empirical Methods. Springer. find
  5. Diab, M., Hacioglu, K., and Jurafsky, D. (2007). Automated Methods for Processing Arabic Text: From Tokenization to Base Phrase Chunking. In van den Bosch, A. and Soudi, A., editors, Arabic Computational Morphology: Knowledge-based and Empirical Methods. Kluwer/Springer. find
  6. Diab, M., Habash, N., Rambow, O., and Roth, R. (2013). LDC Arabic Treebanks and Associated Corpora: Data Divisions Manual. Technical Report CCLS-13-02, Center for Computational Learning Systems, Columbia University. find
  7. Fan, R.-E., Chang, K.-W., Hsieh, C.-J., Wang, X.-R., and Lin, C.-J. (2008). Liblinear: A library for large linear classification. Journal of Machine Learning Research, 9:1871–1874. find
  8. Graff, D., Maamouri, M., Bouziri, B., Krouna, S., Kulick, S., and Buckwalter, T. (2009). Standard Arabic Morphological Analyzer (SAMA) Version 3.1. Linguistic Data Consortium LDC2009E73. find
  9. Habash, N. and Rambow, O. (2005). Arabic Tokenization, Part-of-Speech Tagging and Morphological Disambiguation in One Fell Swoop. In Proceedings of the 43rd Annual Meeting of the Association for Computational Linguistics (ACL’05), pages 573–580, Ann Arbor, Michigan. find our card
  10. Habash, N. and Rambow, O. (2006). MAGEAD: A Morphological Analyzer and Generator for the Arabic Dialects. In Proceedings of the 21st International Conference on Computational Linguistics and 44th Annual Meeting of the Association for Computational Linguistics, pages 681–688, Sydney, Australia. find our card