Morphotactic Modeling in an Open-source Multi-dialectal A rabic Morphological Analyzer and Generator (2022)

Abstract: Arabic is a morphologically rich and complex language, with numerous dialectal variants. Previous efforts on Arabic morphology modeling focused on specific variants and specific domains using a range of techniques with different degrees of linguistic modeling transparency. In this paper we propose a new approach to modeling Arabic morphology with an eye towards multi-dialectness, resource openness, and easy extensibility and use. We demonstrate our approach by modeling verbs from Standard Arabic and Egyptian Arabic, within a common framework, and with high coverage.

## introduction there has been a lot of work on arabic computational morphology in the last three decades @xcite @xcite @xcite . these efforts were motivated by arabic's many challenges, namely, its morphological richness and complexity, its orthographic ambiguity and noise, and its numerous dialectal variants. the work on arabic computational morphology has led to the development of many resources that directly model morphology (e.g., analyzers, generators) and also resources and tools that use them @xcite . morphological analyzers have consistently shown that they are still valuable components in the nlp toolbox, even as the latter increasingly shifts toward the neural modeling space, and especially in low-resource and dialectal settings @xcite @xcite . the range of techniques explored for morphological modeling has been quite large, from finitestate machines to procedural and functional programming languages, covering different degrees of depth in different linguistic representations, different variants, and different domains and genres. however, a common challenge among these approaches is the inconsistent coverage of different linguistic features. for example, the standard arabic morphological analyzer (sama, v3.1) @xcite , which was developed in conjunction with work on modern standard arabic (msa) newswire text in the penn arabic treebank (patb) @xcite , has only 65 imperative verb forms, while it has over 13 thousand perfective verb forms. sama also has only 15 instances of the interrogative proclitic âa foot_0 which in principle can attach to any word. another example is the calima-arz system for egyptian arabic (egy) @xcite , which used automatically generated stem classes making it very hard to linguistically generalize and extend. many of the arabic morphology resources are not freely available, easy to augment, or ready to plug-and-play in open-source public libraries. the work presented in this paper is part of a larger effort on the camelmorph project. 2 camelmorph's goal is to build large open-source morphological models for arabic and its dialects across many genres and domains. the focus in this paper is on the core components that define lexical and morphological information and the tools to convert them into models that are readily usable within an existing python open-source suite for arabic nlp, camel tools @xcite . we demonstrate the effectiveness of our approach by modeling msa and egy verbs using a shared representation, and showing improved coverage compared to publicly available analyzers. our data and code are publicly available. 2 next we present some related work ( §2), a discussion of arabic linguistic background ( §3), and our approach ( §4). we then present the msa and egy verbal models ( §5) and evaluate them ( §6). ## related work there has been a considerable amount of work on arabic morphological analysis @xcite . @xcite organized the various arabic morphology processing efforts along a continuum of approaches that is characterized by two poles: on one end, very abstract and linguistically rich representations and rules are used to derive surface forms; while on the other end, simple and shallow techniques focus on efficient search in a space of pre-compiled (tabulated) solutions. the first type is typically but not strictly implemented using finite-state technology, and was one of the earliest efforts undertaken @xcite @xcite @xcite . these models can be rather complex and have many internal dependencies among the rules used for modeling sub-word structure and morphotactic and orthographic forms. the second type is typically not implemented in finite-state technology. examples include the buckwalter arabic morphological analyzer (bama) @xcite and extensions of it @xcite . these systems do not represent the morphemic, phonological and orthographic rules directly, and instead compile their effect into the lexicon itself. @xcite demonstrated a method of mapping from the pre-compiled tabulated approaches to finite-state representation; and @xcite demonstrated the reverse process of going from finite-state to the tabulated representation. in this paper we present an approach that is a middle ground between these two poles. in lieu of generative solutions employing rewrite rules to map from underlying forms (morphemes) to surface forms (allomorphs), we enumerate, in a limited pre-compiled manner, the various allomorphic forms, and indicate the different context conditions that select for their realization. our morphological specifications also include information about how to order these different morphemes. then, in an offline process, we convert our morphological specifications into a full pre-compiled tabulated format in the style of bama @xcite and calima star @xcite databases (dbs) used in the open-source python toolkit camel tools @xcite . camel tools's morphological engines enable the use of the same morphological db for analysis, generation, and reinflection. our approach is closest to hockett (1954)'s item-and-arrangement approach, linguistically speaking; however, we do make use of post-processing transformations (a la item-and-process) in a limited way for phonological and orthographic phenomena that do not change the basic letter spelling of the arabic word, but can change its diacritics. also, to maximize the utility of our models, we use lemmas and features that allow us to relate our output to word and paradigm approaches @xcite . finally, while we do not explicitly rely on roots and patterns to derive our forms, as was done by @xcite , and @xcite , we plan, in future efforts, to abstract from existing entries templatic patterns that allow us to back off intelligently to unseen words if needed. ## the camelmorph approach figure 1 presents the overall approach we take in the camelmorph project. the leftmost three boxes (camelmorph specs, db maker and db) represent the offline process to create a camel tools-compatible morphological database (camelmorph db) from camelmorph specifications (specs). the rightmost part of the figure represents the online process of using the db in the camel tools morphological analysis and generation engines, where an input word results in a number of possible analyses, and an analysis can result in one or more words. while we focus in this paper on the process of creating camel tools-compatible dbs, the overall approach can be used to generate other repre- mo morph order dbprefix dbstem dbsuffix katab+ti+hi [conj] [pvstem] [pvbuff] [pvsuff] [pron] nahat+~umuw+hu ran~+uw+hu class lemma/ morpheme form gloss set conds required conds ranan+ta ram+a+hu lexicon l1 [pvstem] katab katab write trans ✓ l2 [pvstem] nahat nahat sculpt #t trans ✓ l3a [pvstem] ran~ran~ring trans v-suff ✓ l3b [pvstem] ran~ranan ring trans c-suff ✓ l4 [pvstem] ramay ram throw #-ay trans ✓ buffers b1 [pvbuff] else ✓ ✓ b2a [pvbuff] ay #-ay z-suff else b2b [pvbuff] a #-ay z-suff obj ✓ b2c [pvbuff] ay #-ay c-suff b2d [pvbuff] #-ay v-suff affixes a1a [pvsuff] suff.p3ms a he v-suff else a1b [pvsuff] suff.p3ms he z-suff #-ay ✓ a2 [pvsuff] suff.p3fs at she v-suff a3a [pvsuff] suff.p3mp uwa they [mp] v-suff else else a3b [pvsuff] suff.p3mp uw they [mp] v-suff else obj ✓ a3c [pvsuff] suff.p3mp awa they [mp] v-suff #-ay else a3d [pvsuff] suff.p3mp aw they [mp] v-suff #-ay obj a4a [pvsuff] suff.p2ms ta you [ms] c-suff else ✓ a4b [pvsuff] suff.p2ms ~a you [ms] c-suff #t a5a [pvsuff] suff.p2fs ti you [fs] c-suff suff-i else ✓ a5b [pvsuff] suff.p2fs ~i you [fs] c-suff suff-i #t a6a [pvsuff] suff.p2mp tum you [mp] c-suff else else a6b [pvsuff] suff.p2mp tumuw you [mp] c-suff else obj a6c [pvsuff] suff.p2mp ~um you [mp] c-suff #t else a6d [pvsuff] suff.p2mp ~umuw you [mp] c-suff #t obj ✓ clitics c1 [pron] ✓ c2a [pron] pron.3ms hu him obj trans else ✓ ✓ ✓ c2b [pron] pron.3ms hi him obj trans suff-i ✓ sentations, e.g., finite-state machinery (directly or indirectly as @xcite has previously demonstrated). we chose to work with camel tools because it is a python toolkit with growing popularity, and its morphological engine is relatively efficient. next, we describe the various components of the camelmorph db making process. ## modeling arabic verbs we developed two morphological models for msa and egy verbs. this effort made use of publicly available resources and tools, together with extensive reformulation, quality assessment, and reference cross-checking by a team of linguists and computer scientists. for msa in particular, we filled many known gaps in previous models, namely, adding passive and imperative forms, and the interrogative proclitic. we also added some admittedly archaic forms from classical arabic: energetic and extra energetic moods and indirect object pronominal clitics used with ditransitive verbs. for egy, we paid special attention to completing verbal paradigms and modeling phono-orthographic phenomena. the total number of morphological specifications outside the lexicon ( looking at the stem counts in both msa and egy ( in terms of the total number of analyses ( ## evaluation we present two recall-based evaluations to measure the quality of the new verb morphological models we developed. ## conclusion and future work we presented a new approach to modeling arabic morphotactics and demonstrated its usefulness by creating a large-scale verbal analyzer for msa and egy using a common framework. all of our models and code will be publicly available. in the future, we plan to extend our work to all other pos classes in msa and egy, as well as target other dialects of arabic. some of the interesting challenges we want to address are noisy spelling, dialect-msa intra-word code switching, and template-based backoff modeling.