1. Introduction
The popularity of social media sites and microblogging services, such as Facebook, YouTube and Twitter, has grown exponentially in the last 15 years; the greater the number of users, the more the information is shared, widening the vast ocean of contents generated. The users of social media platforms in Arabic countries are no exception. This abundance of user-generated data has resulted in a rich display of dialects and vernaculars in written form.
Analysing online user-generated contents requires us to consider the appearance of dialects that differ from formal language (i.e., modern standard Arabic (MSA)) on multiple levels including sound, vocabulary, grammar and syntax. Therefore, the considerable number of available MSA Natural Language Processing (NLP) tools implemented and trained on MSA contents may not be directly appropriate or applicable to dialectal Arabic contents. The use of MSA NLP tools on dialectal contents, in fact, yields poor performance, and in turn diverts the researchers’ focus to building the tools necessary to process these dialects. These dedicated resources and tools are considered as the first step towards analysing social media contents and building machine learning applications for various essential purposes such as cyber security, detection of suspicious accounts of individuals and groups, and detection of fake news on social media (Rosso et al. Reference Rosso, Rangel Pardo, Ghanem and Charfi2018; Alorini and Rawat Reference Alorini and Rawat2019; Kanan, Aldaaja, and Hawashin Reference Kanan, Aldaaja and Hawashin2020; Farid and El-Tazi Reference Farid and El-Tazi2020).
There are many challenges to address simultaneously when working with online user-generated contents. For example, the majority of this content does not consist purely of one variety of Arabic. Conversely, the content alternates between MSA and dialectal Arabic, thereby presenting the great challenge of processing more than one variety of Arabic in the same piece of text, such as a sentence or a paragraph. Another challenge is the large number of existing Arabic dialects, which reaches up to 36, according to the annual reference on the languages of the world (Ethnologue) in its 22nd edition (Eberhard et al. Reference Eberhard, Simons and Fennig2019). This number and diversity of Arabic dialects truly presents significant difficulty to Arabic NLP, in which it is necessary to create resources and implement tools capable of handling multiple Arabic dialects along with various genres, domains and scopes.
In this paper, we present a solution to the limited sets of resources for Arabic dialects whose manual creation costs effort and time. We propose a novel approach to automatically create a country-level annotated corpus for 15 Arabic dialects. The approach takes advantage of the large amount of online user-generated data in its raw form, and the poor performance of MSA tools when applied on dialectal contents.
This paper is organised as follows: after discussing Arabic dialectology, explaining differences between Arabic dialects, and displaying the challenges of processing dialectal Arabic, we present a general view of the dialectal Arabic resources that have been constructed in various NLP tasks (e.g., morphological analysis, machine translation, etc). In effort to detail our proposed solution to construct and annotate resources for the Arabic Dialect Identification (ADI) task, Section 4 is devoted to providing an overview of existing resources for the ADI task. Our overall framework to automatically tackle the limited resources of dialectal Arabic is explained in Section 5. Section 6 contains the detailed explanation of our automatic algorithm designed to create and filter word lists for the 15 Arabic dialects, while Section 7 describes the creation of the annotated corpus. Additionally, experimental settings and characteristics of all resources implemented are illustrated in Section 8. Then, we manually evaluate the quality of the resources by carrying out a human dialect identification task and discuss the results in Section 9. Finally, we present the conclusion of the proposed method.
2. Arabic dialectology
Arabic is one of many Semitic languages spoken throughout the Middle East and North Africa. Arabic is veritably the largest living language of the Semitic family and one of the most widely spoken languages in the world, used daily by more than 300 million people (Hetzron Reference Hetzron2005; Azoulay Reference Azoulay2017; Testen Reference Testen2018).
The Arabic language generally refers to a collection of multiple varieties. These varieties include one particular standardised form, MSA and many non-standardised regional dialects. MSA is used in formal events, sermons, education, university lectures, political speeches, news broadcasts and formal written texts. It is mostly written rather than spoken and serves as the official language of more than 20 countries. The syntax, morphology and phonology of MSA are fundamentally based on Classical Arabic (CA), the language of Qur’an, the holy book of Islam. The MSA lexis, however, is more modern, and the stylistics of MSA is, to some extent, different from that of CA. On the other hand, regional dialects are utilised for informal daily communication, including radio and soap operas. These dialects are primarily spoken not written and are seen as the forms of true native language.
The continuum from the highest (most prestigious) CA to the lowest (most colloquial) dialect led to what is known as ‘diglossia’ where two varieties of the same language exist side by side, each performing a different function. That is, while colloquial Arabic is informally learnt from daily conversations, MSA is studied in schools (Ferguson Reference Ferguson1959; Kaye and Rosenhouse Reference Kaye, Rosenhouse and Hetzron2005). The geographical continuum resulted in innumerable sets of dialects possessing similarities and differences to various degrees, according to their distance from each other and from the original centre where Arabic was originally developed. The greater the distance between two places, the greater the differences between their colloquial dialects (Kaye and Rosenhouse Reference Kaye, Rosenhouse and Hetzron2005).
2.1 Division of the Arabic dialects
Geographical location is the main factor producing many Arabic dialects. Most studies categorise Arabic dialects generally into eastern and western dialects (Barkat, Ohala, and Pellegrino Reference Barkat, Ohala and Pellegrino1999; Ghazali, Hamdi, and Barkat Reference Ghazali, Hamdi and Barkat2002; Watson Reference Watson2002; Kaye and Rosenhouse Reference Kaye, Rosenhouse and Hetzron2005). The eastern dialects include those spoken in the Arabian Peninsula (Saudi Arabia, Oman, Yemen, the United Arab Emirates, Qatar, Kuwait, Bahrain), Mesopotamia (Iraqi dialects), Levantine (Syrian, Lebanese, Jordanian, and Palestinian dialects), and Egypt (Egyptian dialects). The western dialects are those spoken in countries located west of Egypt, including Libya, Tunisia, Algeria, Morocco and Mauritania.
The annual reference on the languages of the world (Ethnologue) in its 22nd edition defines 36 Arabic dialects. These dialects are spoken in the Middle East and North Africa in the area spreading from Morocco and Mauritania in the west to Oman in the east, as well as countries from north-central and northeast Africa, such as Sudan and Chad. Ethnologue considers Tajiki, Uzbeki, Cypriot and Maltese, spoken in central Asia and island countries in the Mediterranean sea, also among Arabic dialects (Eberhard et al. Reference Eberhard, Simons and Fennig2019).
The Glottolog, a bibliographic database of the world’s languages and language families, classifies colloquial Arabic into 5 groups, composed of 38 dialects (Hammarström, Forkel, and Haspelmath Reference Hammarström, Forkel and Haspelmath2018). The five groups are Arabian Peninsula Arabic, Eastern Arabic, Egyptic Arabic, Levantine Arabic, and North African Arabic. The two Arabic dialects that are mentioned in the Glottolog, but not in the Ethnologue, are Nubi and Khorasan Arabic.
Although geographical location plays an effective role in obtaining various Arabic dialects, several additional factors impact the appearance of Arabic dialects, even within the same geographical region. These factors include lifestyle, religion, education and socio-economic status (Watson Reference Watson2002; Holes Reference Holes2004).
According to Ethnologue (Reference Eberhard, Simons and Fennig2019), there are approximately 89 million Egyptian Arabic speakers, roughly 22.4 million of whom speak Sa’idi, 2.2 million speak Eastern Egyptian Bedawi, and 64.4 million speak Modern Egyptian. Modern Egyptian includes north and south central Delta Arabic and Cairene Arabic, which is widely understood in the Arab world and used in media (Eberhard et al. Reference Eberhard, Simons and Fennig2019). This makes Modern Egyptian the most popular dialect in the Arab world. Table 1 summarises the number of speakers of the 36 Arabic dialects.
Number of speakers of the 36 Arabic dialects according to Ethnologue (Reference Eberhard, Simons and Fennig2019)

2.2 Challenges of processing dialectal Arabic
There are several difficulties facing the NLP research community when processing dialectal Arabic. These challenges arise in part due to the inherent properties of the Arabic language itself, while the remaining challenges occur as a result of the differences between Arabic dialects on one side and MSA on the other side, as well as the differences between Arabic dialects themselves.
Complex morphology. Dialectal Arabic inherits the complex morphology of MSA due to the rich inflectional morphology (i.e., affixes) that models aspect, case, gender, mood, number, person, state and voice. Therefore, the word takes many forms. Moreover, there are a large number of clitics, such as conjunctions and future particles, that can be attached to the word. The attached clitics significantly increase the number of possible forms of the word (Habash et al. Reference Habash, Eryani, Khalifa, Rambow, Abdulrahim, Erdmann, Faraj, Zaghouani, Bouamor, Zalmout, Hassan, Al-Shargi, Alkhereyf, Abdulkareem, Eskander, Salameh and Saddiki2018). Although MSA is morphologically richer than dialectal Arabic in some dimensions, such as gender, case and mood (e.g., Arabic dialects mostly lack the dual form found in MSA), Arabic dialects generally have a more complex cliticisation system than MSA (e.g., circumfix negation in Arabic dialects) (Zaidan and Callison-Burch Reference Zaidan and Callison-Burch2014). In addition, dialectal Arabic has clitics and affixes that are not part of MSA morphology (Habash et al. Reference Habash, Eskander and Hawwari2012b).
Cross-dialectal differences. Linguistic differences do not only appear between MSA and dialectal Arabic, but also between Arabic dialects. The linguistic diversity of Arabic dialects emerges at all levels including morphology, syntax, lexicon and phonology. Moreover, distinct degrees of linguistic distance occur based on geographical distance, education, social class and other potential factors (Diab and Habash Reference Diab and Habash2007). Consequently, the complex relationship between Arabic dialects creates a scenario in which NLP applications are impeded, since a pre-made tool that is suited to one Arabic variety will not perform well for another (Habash et al. Reference Habash, Eskander and Hawwari2012b; Shoufan and Alameri Reference Shoufan and Alameri2015).
Limited resources. MSA has received much attention in Arabic NLP; a large number of resources have been built so far and many proposed semi-automatic approaches have been used to generate more annotated data (Habash Reference Habash2010). However, these data cannot be utilised when addressing dialectal Arabic texts due to the linguistic differences between MSA and Arabic dialects. Therefore, many works on Arabic NLP that handle the web and social media texts have created their own annotated resources to fill in the gaps. More effort should be made as the current available dialectal Arabic datasets are limited in terms of size, scope and scale (Diab and Habash Reference Diab and Habash2007; Zaidan and Callison-Burch Reference Zaidan and Callison-Burch2014; Habash et al. Reference Habash, Eryani, Khalifa, Rambow, Abdulrahim, Erdmann, Faraj, Zaghouani, Bouamor, Zalmout, Hassan, Al-Shargi, Alkhereyf, Abdulkareem, Eskander, Salameh and Saddiki2018).
Script choices. The main script that is usually used to write dialectal Arabic text is Arabic script. However, dialectal Arabic sometimes appears on social media and generally on the web in a non-standard romanisation, often called Arabizi (Darwish Reference Darwish2014; Habash et al. Reference Habash, Eryani, Khalifa, Rambow, Abdulrahim, Erdmann, Faraj, Zaghouani, Bouamor, Zalmout, Hassan, Al-Shargi, Alkhereyf, Abdulkareem, Eskander, Salameh and Saddiki2018).
Ambiguous orthography. Arabic script, the most common form of writing dialectal Arabic, employs optional diacritical marks for short vowels and consonantal gemination (Habash et al. Reference Habash, Eryani, Khalifa, Rambow, Abdulrahim, Erdmann, Faraj, Zaghouani, Bouamor, Zalmout, Hassan, Al-Shargi, Alkhereyf, Abdulkareem, Eskander, Salameh and Saddiki2018). The absence of diacritical marks is the main source of ambiguity in Arabic NLP (Habash Reference Habash2010). It is also the main source of ambiguity when trying to recognise Arabic dialects in the written text. That is, pronunciation of vocabulary sometimes differs from one Arabic dialect to another while the written vocabulary is identical because diacritical marks, which are used to reflect differences in pronunciation, are always omitted in the written text. For example, the word (
, bAb,‘door’)Footnote
a
is written the same way in all Arabic dialects but pronounced differently (e.g., /ba:b/Footnote
b
in Gulf dialects and /be:b/ in Maghrebi dialects).
Inconsistent orthography. Unlike MSA, Arabic dialects have no official orthographies and generally have no well-defined orthographic standards. Therefore, there is a degree of variety in dialectal spelling. That is, a single word in any dialect may be written in a large number of possible ways based on independent decisions. For example, the Egyptian word (
, mAbyqulhAš,‘he does not say it’) was found written 27 different ways according to Google Search (e.g.,
) (Habash et al. Reference Habash, Eryani, Khalifa, Rambow, Abdulrahim, Erdmann, Faraj, Zaghouani, Bouamor, Zalmout, Hassan, Al-Shargi, Alkhereyf, Abdulkareem, Eskander, Salameh and Saddiki2018).
3. NLP resources for Arabic dialects
This section presents the dialectal Arabic resources that have been constructed for various NLP issues, such as morphological analysis, POS tagging, sentiment analysis and machine translation.
3.1 Morphological analysis and POS tagging
Morphological analysis has gained significant attention in dialectal Arabic NLP. Diab et al. (Reference Diab, Habash, Rambow, Altantawy and Benajiba2010) described the Cross-Lingual Arabic Blog Alerts (COLABA) project, a great effort to create resources for dialectal Arabic blogs covering Egyptian, Levantine, Iraqi and Moroccan Arabic. Their study focused on harvesting online sources, such as blogs and forums, to create resources for dialectal Arabic. For each dialectal surface word, the annotators were asked to provide a lemma, identify the various possible POS tags and provide a detailed morphological profile for nouns, adjectives and verbs. For example, they were required to enter the feminine singular form of the noun, if available. Al-Sabbagh and Girju (Reference Al-Sabbagh and Girju2012) presented YADAC, a multi-genre and multi-dialectal Arabic corpus collected from Twitter, online knowledge market services and blogs. The corpus provides linguistic analysis at the POS tagging and base-phrase chunking levels.
Al-Shargi et al. (Reference Al-Shargi, Kaplan, Eskander, Habash and Rambow2016) presented morphologically annotated corpora for Moroccan and Sanaani Yemeni Arabic. The corpora data were collected from both online and print materials such as internet comments, forums, oral interviews, folktales, sermons, textbooks, blogs and Facebook posts. They transcribed the Roman alphabet sentences from the textbooks into the Arabic alphabet using Conventional Orthography for Dialectal Arabic (CODA), which is a consistent orthographic system for writing Arabic dialects developed by Habash, Diab, and Rambow (Reference Habash, Diab and Rambow2012a). As the authors processed Moroccan and Yemeni dialects, they also created specific CODA guidelines for Moroccan and Yemeni inspired by the work of Habash et al. (Reference Habash, Diab and Rambow2012a, 2018). Furthermore, the Curras corpus, developed by Jarrar et al. (Reference Jarrar, Habash, Alrimawi, Akra and Zalmout2017), is the first morphologically annotated corpus of the Palestinian Arabic dialect. The corpus data were collected from a variety of resources including Facebook, Twitter, forums, blogs and TV shows. The annotation was defined as a tuple of many tags including lemma, MSA lemma, Buckwalter POS tag and grammatical properties (i,e., person, aspect, gender and number). They took advantage of the MADAMIRA disambiguation tool (Pasha et al. Reference Pasha, Al-Badrashiny, Diab, El Kholy, Eskander, Habash, Pooleery, Rambow and Roth2014), which includes the CALIMA analyser (Habash et al. Reference Habash, Eskander and Hawwari2012b), and the DIWAN dialectal word annotation interface (Al-Shargi and Rambow Reference Al-Shargi and Rambow2015). The Levantine Arabic Treebank (LATB) of Jordanian Arabic was developed by Maamouri et al. (Reference Maamouri, Bies, Buckwalter, Diab, Habash, Rambow and Tabessi2006) at the Linguistic Data Consortium (LDC). The corpus was collected from Levantine conversational telephone speech and was morphologically and syntactically annotated based on the guidelines of the MSA Penn Arabic Treebank (PATB) (Maamouri et al. Reference Maamouri, Bies, Buckwalter and Mekki2004) with some extensions.
The Egyptian Arabic Treebank corpus was collected from online informal texts (e.g., discussion forum posts) at the LDC (Maamouri et al. Reference Maamouri, Bies, Kulick, Tabessi and Krouna2012, Reference Maamouri, Bies, Kulick, Ciul, Habash and Eskander2014). The corpus was developed and annotated using an early versions of the CALIMA analyser (Habash et al. Reference Habash, Eskander and Hawwari2012b), as well as annotators who were allowed to manually annotate words. More recently, the BOLT Egyptian Arabic Treebank corpus was developed by the LDC (Maamouri et al. Reference Maamouri, Bies, Kulick, Krouna, Tabassi and Ciul2018). The corpus contains data collected from discussion forums and annotated with information for part-of-speech (POS) category, morphology, gloss and syntactic tree. Khalifa et al. (Reference Khalifa, Habash, Eryani, Obeid, Abdulrahim and Al Kaabi2018) developed a large-scale morphologically annotated corpus of Emirati Arabic. The contents of the corpus were selected from eight novels of the Emirati Arabic variety of the Gumar corpus (Khalifa et al. Reference Khalifa, Habash, Abdulrahim and Hassan2016). The corpus contains about 200,000 words with POS categories, lemmatisation, English glosses and dialect identification annotations.
Samih et al. (Reference Samih, Attia, Eldesouki, Abdelali, Mubarak, Kallmeyer and Darwish2017) used a corpus, containing 350 tweets with more than 8000 words including 3000 words written in the Egyptian dialect. They manually annotated each word to provide: stem, lemma, CODA-compliant writing (Habash et al. Reference Habash, Diab and Rambow2012a), segmentation and POS tags, as well as the corresponding MSA word, MSA segmentation and MSA POS tags. Furthermore, a collection of 1400 segmented and annotated tweets was developed by Eldesouki et al. (Reference Eldesouki, Samih, Abdelali, Attia, Mubarak, Darwish and Laura2017) for Egyptian, Levantine, Gulf and Maghrebi dialects. Also, Darwish et al. (Reference Darwish, Mubarak, Abdelali, Eldesouki, Samih, Alharbi, Attia, Magdy and Kallmeyer2018) developed a new dataset composed of 350 POS-tagged Arabic tweets for each of the 4 major dialects: Egyptian, Levantine, Gulf and Maghrebi.
3.2 Sentiment analysis
Arab people usually write in their native dialects to express personal opinions on social media and in discussion forums. In fact, a large amount of online contents are user-generated and written in dialects. Therefore, dialectal Arabic NLP plays a vital role in sentiment analysis (SA) and opinion mining research. Many studies developed the required resources for their SA on various Arabic dialects. Abdul-Mageed and Diab (Reference Abdul-Mageed and Diab2012) manually developed SIFAAT, a sentiment lexicon that contains 3325 adjectives annotated as positive, negative or neutral. The SIFAAT lexicon was automatically extended using machine translation and statistical formulation to create SANA (Abdul-Mageed and Diab Reference Abdul-Mageed and Diab2014). SANA contains 224,564 entries, covering MSA as well as Egyptian and Levantine dialects. Developing SANA involved the use of many Arabic lexical resources such as THARWA, a large-scale dialectal Arabic – standard Arabic – English lexicon (Diab et al. Reference Diab, Al-Badrashiny, Aminian, Attia, Elfardy, Habash, Hawwari, Salloum, Dasigi and Eskander2014).
Ameur, Jamoussi, and Hamadou (Reference Ameur, Jamoussi and Hamadou2016) proposed a new method to develop a dictionary for emotion analysis. They used emotion symbols as sentiment polarity indicators to collect the data from Tunisian Facebook pages. NileULex is a sentiment lexicon containing single-word terms and compound phrases for MSA and Egyptian dialects. The terms were automatically extracted from social media, but they were manually annotated to ensure the quality (El-Beltagy Reference El-Beltagy2016). During implementation of the WeightedNileULex, an extension of NileULex, presented by El-Beltagy (Reference El-Beltagy2017), an automatic method was proposed and used to assign strength scores or weights to NileULex entries.
A considerable number of corpora in the literature have been developed intending to serve SA for Arabic dialects. For instance, Siddiqui, Dahab, and Batarfi (Reference Siddiqui, Dahab and Batarfi2015) developed a multilingual annotated corpus for SA, consisting of 191K reviews of hotels in Saudi Arabia written mostly in Arabic and English, and very few reviews in other languages. The annotation used for SA contains 11 categories ranging from exceptional to very poor. AraSenti-Tweet is another SA corpus, containing 17,573 tweets written mainly in the Saudi dialect. The corpus was annotated with four sentiment labels: positive, negative, neutral and mixed (Al-Twairesh et al. Reference Al-Twairesh, Al-Khalifa, Al-Salman and Al-Ohali2017). MIKA (Ibrahim, Abdou, and Gheith Reference Ibrahim, Abdou and Gheith2015) is a multi-genre SA corpus manually annotated (positive, negative or neutral) at sentence level for MSA and the Egyptian dialect. MIKA contains 4000 reviews collected from Twitter, product reviews, hotel reviews and TV programs reviews.
Hamdi, Shaban, and Zainal (Reference Hamdi, Shaban and Zainal2018) developed a multifaceted corpus, containing 15,274 reviews from various sources such as surveys, Facebook comments and Twitter posts related to governmental services. The different facets of the corpus are domains, dialects, linguistic issues and sentiment polarity for which the annotation was carried out manually by trained annotators from different Arab countries. Medhaffar et al. (Reference Medhaffar, Bougares, Estève and Hadrich-Belguith2017) created the Tunisian Sentiment Analysis Corpus (TSAC), consisting of 17K Facebook comments. The corpus was manually annotated with either positive or negative labels.
3.3 Machine translation
It is well known that machine translation systems require parallel corpora for source and target languages. With regard to Arabic dialects, little effort has been made to handle machine translation by enriching the field with necessary parallel corpora. This section illustrates examples of those attempts. For example, Zbib et al. (Reference Zbib, Malchiodi, Devlin, Stallard, Matsoukas, Schwartz, Makhoul, Zaidan and Callison-Burch2012) developed Egyptian-English and Levantine-English parallel corpora, consisting of 380k words and 1.1M words, respectively. The sentences of the corpus were extracted from web texts and translated using a crowdsourcing platform,Footnote c more specifically Amazon’s Mechanical Turk (MTurkFootnote d ). The data were utilised for building dialectal machine translation systems.
Additionally, Jehl, Hieber, and Riezler (Reference Jehl, Hieber and Riezler2012) created a parallel Twitter corpus using MTurk. That is, 1022 Arabic messages were collected randomly from Twitter, cleaned and then used in the MTurk task to be translated by workers into English. Their study covers three Arabic dialects: Egyptian, Gulf and Levantine, as well as MSA. Meftouh et al. (Reference Meftouh, Harrat, Jamoussi, Abbas and Smaili2015) created PADIC, a parallel Arabic dialect corpus, covering five dialects: Annaba’s dialect (spoken in the east of Algeria), Algiers’s dialect (spoken in the capital of Algeria), Sfax’s dialect (spoken in the south of Tunisia), Syrian and Palestinian dialects, as well as MSA. The authors examined the PADIC parallel corpus by conducting cross-lingual machine translation between all language pairs.
3.4 Other tasks
Many studies in the literature have developed annotated dialectal Arabic resources amidst work on domains whose contents are written mainly in Arabic dialects in order to tackle various NLP problems. Examples of such tasks include sentence boundary detection (Diab et al. Reference Diab, Habash, Rambow, Altantawy and Benajiba2010; Zribi et al. Reference Zribi, Ellouze, Belguith and Blache2015, Reference Zribi, Kammoun, Ellouze, Belguith and Blache2016), orthography (Habash et al. Reference Habash, Diab and Rambow2012a; Saadane and Habash Reference Saadane and Habash2015; Shoufan and Alameri Reference Shoufan and Alameri2015; Turki et al. Reference Turki, Adel, Daouda and Regragui2016; Khalifa et al. Reference Khalifa, Habash, Abdulrahim and Hassan2016; Jarrar et al. Reference Jarrar, Habash, Alrimawi, Akra and Zalmout2017) and automatic diacritics restoration (Harrat et al. Reference Harrat, Abbas, Meftouh and Smaili2013).
4. Resources for ADI
As this paper presents our proposed approach to construct and annotate resources for the ADI task, this section is devoted to providing an overview of existing resources that can be used for the ADI task. We examine these existing resources from different points of view and based on different factors. Three factors have been taken into account: the methods used to collect and annotate the resource texts, the sources from which the data of the resources are collected and the dialects that are covered in these resources.
4.1 Sources of the collected data
Dialectal Arabic varieties are not typically written, but spoken. Consequently, the main sources from which dialectal Arabic can usually be derived are daily conversations, radio broadcasts, podcasts, movies and TV shows. Therefore, many studies in ADI research relied on transcripts of these audio sources, as well as telephone conversations and transcribed speech, in order to build annotated dialectal Arabic corpora (Gadalla et al. Reference Gadalla, Kilany, Arram, Yacoub, El-Habashi, Shalaby, Karins, Rowson, Mac-Intyre, Kingsbury, Graff and McLemore1997; McNeil and Faiza Reference McNeil and Faiza2011; Meftouh et al. Reference Meftouh, Harrat, Jamoussi, Abbas and Smaili2015; Malmasi et al. Reference Malmasi, Zampieri, Ljubešić, Nakov, Ali and Tiedemann2016).
Regarding their written form, Arabic dialects have an increased presence on the web, as social media allows users to engage in more informal conversations (Shao Reference Shao2009). Fortunately, excellent content is now available on the web, either in ‘pure’ dialectal Arabic, or in a middle language which could be considered a ‘conversational’ register of MSA or a ‘high’ register of dialects. Many studies exploit the Arabic web text as a source to collect dialectal material (Zbib et al. Reference Zbib, Malchiodi, Devlin, Stallard, Matsoukas, Schwartz, Makhoul, Zaidan and Callison-Burch2012; Almeman and Lee Reference Almeman and Lee2013; Bouamor, Habash, and Oflazer Reference Bouamor, Habash and Oflazer2014).
Blogs and online discussion forums have also proved to be a productive source of dialectal data. The blog entries and forum postings usually represent important everyday topics such as sports, technology and lifestyle. Therefore, they are written in a very informal, conversational style. Many studies examined the contents of forums and blogs when building annotated dialectal Arabic datasets (McNeil and Faiza Reference McNeil and Faiza2011; Elfardy and Diab Reference Elfardy and Diab2012; Sadat, Kazemi, and Farzindar Reference Sadat, Kazemi and Farzindar2014; Khalifa et al. Reference Khalifa, Habash, Abdulrahim and Hassan2016; Abu Kwaik et al. Reference Abu Kwaik, Saad, Chatzikyriakidis and Dobnik2018). In addition, the reader commentary from online Arabic newspapers were used to build corpora for Arabic dialects by Zaidan and Callison-Burch (Reference Zaidan and Callison-Burch2011, Reference Zaidan and Callison-Burch2014), and Cotterell and Callison-Burch (Reference Cotterell and Callison-Burch2014).
Social media platforms such as Twitter, YouTube and Facebook contain posts, messages and users’ comments that are written in Arabic dialects. A considerable number of researchers have considered social media to build the required linguistic resources for ADI. Therefore, Twitter has been exploited, especially in recent years, to build a number of annotated corpora for different sets of Arabic dialects (Cotterell and Callison-Burch Reference Cotterell and Callison-Burch2014; Mubarak and Darwish Reference Mubarak and Darwish2014; Alshutayri and Atwell Reference Alshutayri and Atwell2017; Alsarsour et al. Reference Alsarsour, Mohamed, Suwaileh and Elsayed2018; Mubarak Reference Mubarak2018; Zaghouani and Charfi Reference Zaghouani and Charfi2018; Abu Kwaik et al. Reference Abu Kwaik, Saad, Chatzikyriakidis and Dobnik2018; Abdul-Mageed, Alhuzali, and Elaraby Reference Abdul-Mageed, Alhuzali and Elaraby2018; Bouamor, Hassan, and Habash Reference Bouamor, Hassan and Habash2019). User comments on YouTube videos have also been utilised to build dialectal corpora for a number of Arabic dialects (Salama et al. Reference Salama, Bouamor, Mohit and Oflazer2014; Abidi, Menacer, and Smaili Reference Abidi, Menacer and Smaili2017). Facebook messages, user comments and posts have also been used to build the dialectal corpora (Younes and Souissi Reference Younes and Souissi2014; Huang Reference Huang2015; Younes, Achour, and Souissi Reference Younes, Achour and Souissi2015).
Traditional written sources including folk poetry, song lyrics, collections of proverbs, and scripts for movies, plays, and television shows serve as solid sources of written Arabic dialects for building corpora (McNeil and Faiza Reference McNeil and Faiza2011). Likewise, SMS messages are typically written in an informal and conversational style, qualifying them as valuable sources for building dialectal Arabic datasets, as in the study of Younes and Souissi (Reference Younes and Souissi2014).
The translation of available existing sources from one language and/or specific dialect to another is another way to build resources for dialects. For example, the Multidialectal Parallel Corpus of Arabic (MPCA) (Bouamor et al. Reference Bouamor, Habash and Oflazer2014) contains 2000 parallel sentences, covering 5 dialects: Egyptian, Tunisian, Jordanian, Palestinian and Syrian Arabic, as well as MSA. The corpus was created by translating sentences from the Egyptian part of the Egyptian-English corpus built by (Zbib et al. Reference Zbib, Malchiodi, Devlin, Stallard, Matsoukas, Schwartz, Makhoul, Zaidan and Callison-Burch2012). They asked four translators (native speakers of Jordanian, Palestinian, Syrian and Tunisian) to translate 2000 sentences written in Egyptian into their dialects. A fifth translator also translated the sentences into MSA. The contents of the corpus were harvested from the web, largely from weblog and online user groups. The MADAR Arabic dialect parallel corpora were created by translating English and French sentences from the Basic Travelling Expression Corpus (BTEC) (Takezawa et al. Reference Takezawa, Kikui, Mizushima and Sumita2007) into multiple Arabic dialects (Bouamor et al. Reference Bouamor, Habash, Salameh, Zaghouani, Rambow, Abdulrahim, Obeid, Khalifa, Eryani, Erdmann and Oflazer2018).
4.2 Methods of collecting and annotating data
The methods implemented to collect the dialectal data depend primarily on the sources from which the data are collected. Web sources, such as blogs and discussion forums, are essential when it comes to dialectal written texts. Many studies collected dialectal data on the web by manually navigating the web and downloading dialectal written materials or by performing web crawls of specific web pages or for distinctive dialectal keywords (McNeil and Faiza Reference McNeil and Faiza2011; Zaidan and Callison-Burch Reference Zaidan and Callison-Burch2011; Zbib et al. Reference Zbib, Malchiodi, Devlin, Stallard, Matsoukas, Schwartz, Makhoul, Zaidan and Callison-Burch2012; Almeman and Lee Reference Almeman and Lee2013; Cotterell and Callison-Burch Reference Cotterell and Callison-Burch2014; Khalifa et al. Reference Khalifa, Habash, Abdulrahim and Hassan2016). The various Application Programming Interfaces (APIs) that provide access to social media sites were also employed to collect Arabic dialectal contents from these social media sites such as Twitter, Facebook and Youtube (Mubarak and Darwish Reference Mubarak and Darwish2014; Salama et al. Reference Salama, Bouamor, Mohit and Oflazer2014; Younes et al. Reference Younes, Achour and Souissi2015; Huang Reference Huang2015; Abidi et al. Reference Abidi, Menacer and Smaili2017; Alshutayri and Atwell Reference Alshutayri and Atwell2017; Alsarsour et al. Reference Alsarsour, Mohamed, Suwaileh and Elsayed2018; Zaghouani and Charfi Reference Zaghouani and Charfi2018; Salameh, Bouamor, and Habash Reference Salameh, Bouamor and Habash2018).
Some sources are unavailable in written form, such as recordings of daily conversations, movies and TV shows. Some studies employed native speakers who helped either to transcribe the recordings and audio resources to make them available in written form (McNeil and Faiza Reference McNeil and Faiza2011; Meftouh et al. Reference Meftouh, Harrat, Jamoussi, Abbas and Smaili2015) or to manually translate existing corpora of other languages or dialects into the target dialects in order to create parallel corpora (Zbib et al. Reference Zbib, Malchiodi, Devlin, Stallard, Matsoukas, Schwartz, Makhoul, Zaidan and Callison-Burch2012; Bouamor et al. Reference Bouamor, Habash and Oflazer2014; Meftouh et al. Reference Meftouh, Harrat, Jamoussi, Abbas and Smaili2015; Mubarak Reference Mubarak2018).
After collecting the data, the annotation task required to classify the collected data into a set of Arabic dialects was carried out in various ways. Most studies employed workers on online crowdsourcing platforms (e.g., MTurk and CrowdFlower) to perform annotations (Zaidan and Callison-Burch Reference Zaidan and Callison-Burch2011; Cotterell and Callison-Burch Reference Cotterell and Callison-Burch2014; Alsarsour et al. Reference Alsarsour, Mohamed, Suwaileh and Elsayed2018) or to translate existing specific dialectal corpora into other Arabic dialects and/or different languages, such as English and French, in order to create parallel corpora of different Arabic dialects and languages (Zbib et al. Reference Zbib, Malchiodi, Devlin, Stallard, Matsoukas, Schwartz, Makhoul, Zaidan and Callison-Burch2012; Bouamor et al. Reference Bouamor, Habash and Oflazer2014; Mubarak Reference Mubarak2018).
The semi-supervised learning methods such as co-training and self-training were examined to build dialectal Arabic corpora from Facebook posts (Huang Reference Huang2015). Self-training involved applying a supervised classifier to the unlabelled data to obtain automatically annotated dialect data that can be used to improve the performance of the classifier. The supervised classifier used in Huang’s study was trained on a previously manually annotated dialectal Arabic dataset. The built classifier then was used to automatically annotate Arabic Facebook posts containing 646M words. Co-training involved using two classifiers to annotate the same unlabelled data. A sentence was labelled and used to train the model only when the two classifiers agreed. In the study of Huang (Reference Huang2015), 476M words from Arabic Facebook posts were annotated using the co-training method. Huang (Reference Huang2015) also automatically created a dialectal corpus, relying only on users’ country information in their profiles on Facebook. As a result, the 66M word corpus is not highly accurate since the users’ country information may be missing or unreliable. In many studies, the geographical location provided in user profiles on social media sites, such as Twitter, YouTube and Facebook, were employed to classify the collected data (e.g., posts, comments, tweets and messages) from these sites (Salama et al. Reference Salama, Bouamor, Mohit and Oflazer2014; Mubarak and Darwish Reference Mubarak and Darwish2014; Younes et al. Reference Younes, Achour and Souissi2015; Alshutayri and Atwell Reference Alshutayri and Atwell2017; Salameh et al. Reference Salameh, Bouamor and Habash2018; Abu Kwaik et al. Reference Abu Kwaik, Saad, Chatzikyriakidis and Dobnik2018).
On the other hand, some studies classified collected data into a set of dialects using a degree of supervision in the form of lists of distinctive regional keywords and/or phrases. These words become ‘seed words’ to be used in the process of collecting and annotating the data for each dialect. For example, Almeman and Lee (Reference Almeman and Lee2013) used 1043 dialect words (430 from Gulf dialects, 200 from North African dialects, 274 from Levantine dialects and 139 from Egyptian dialects) as keywords to automatically collect links for each dialect from the web using Bing API. The web pages for each dialect were downloaded and saved as html files. Finally, they cleared noise from the files (e.g., removing unwanted symbols, tags and underscores) and normalised the cleared texts (e.g., removing repeated words and phrases) to obtain a corpus for each dialect.
Many studies also adopted the traditional annotation by employing a group of annotators to perform manual annotation according to given annotation guidelines (Khalifa et al. Reference Khalifa, Habash, Abdulrahim and Hassan2016; Zaghouani and Charfi Reference Zaghouani and Charfi2018).
4.3 Covered dialects
Spoken Arabic is most commonly broken down coarsely into five main dialect groups: Levantine, Gulf, Egyptian, Maghrebi and Iraqi (Habash Reference Habash2010). A large portion of the research on dialectal Arabic resources has been devoted to the creation of annotated corpora for the five aforementioned dialect groups (Zaidan and Callison-Burch Reference Zaidan and Callison-Burch2011; Zbib et al. Reference Zbib, Malchiodi, Devlin, Stallard, Matsoukas, Schwartz, Makhoul, Zaidan and Callison-Burch2012; Almeman and Lee Reference Almeman and Lee2013; Cotterell and Callison-Burch Reference Cotterell and Callison-Burch2014; Zaidan and Callison-Burch Reference Zaidan and Callison-Burch2014; Salama et al. Reference Salama, Bouamor, Mohit and Oflazer2014; Huang Reference Huang2015; Mubarak Reference Mubarak2018). Since further division of the dialect groups is possible, especially in large regions, many country-level Arabic dialects have been addressed in the ADI field. For example, the four sub-dialects (Syrian, Lebanese, Palestinian and Jordanian) of spoken Levantine have received attention in the study of Abu Kwaik et al. (Reference Abu Kwaik, Saad, Chatzikyriakidis and Dobnik2018) which constructed the Shami corpus (SDC), including data from the four sub-dialects spoken in the Levant region. Furthermore, the Egyptian dialect has been studied extensively in a considerable number of works (Zaidan and Callison-Burch Reference Zaidan and Callison-Burch2011; Zbib et al. Reference Zbib, Malchiodi, Devlin, Stallard, Matsoukas, Schwartz, Makhoul, Zaidan and Callison-Burch2012; Almeman and Lee Reference Almeman and Lee2013; Salama et al. Reference Salama, Bouamor, Mohit and Oflazer2014; Mubarak and Darwish Reference Mubarak and Darwish2014; Bouamor et al. Reference Bouamor, Habash and Oflazer2014; Diab et al. Reference Diab, Al-Badrashiny, Aminian, Attia, Elfardy, Habash, Hawwari, Salloum, Dasigi and Eskander2014; Mubarak Reference Mubarak2018), as has been the Tunisian, a sub-dialect of Maghrebi (McNeil and Faiza Reference McNeil and Faiza2011; Boujelbane et al. Reference Boujelbane, Khemekhem, BenAyed and Belguith2013; Bouamor et al. Reference Bouamor, Habash and Oflazer2014; Younes and Souissi Reference Younes and Souissi2014; Bouchlaghem, Elkhlifi, and Faiz Reference Bouchlaghem, Elkhlifi and Faiz2014; Younes et al. Reference Younes, Achour and Souissi2015). More specifically, the dialect of Sfax city in the southeast of Tunis has been the focus of a number of studies (Meftouh et al. Reference Meftouh, Harrat, Jamoussi, Abbas and Smaili2015; Bouamor et al. Reference Bouamor, Habash, Salameh, Zaghouani, Rambow, Abdulrahim, Obeid, Khalifa, Eryani, Erdmann and Oflazer2018). Spoken Algerian belonging to the Maghrebi group of dialects has been covered in selected studies, such as (Abidi et al. Reference Abidi, Menacer and Smaili2017), while others specifically addressed the Algerian city dialects of Algiers and Annaba (Meftouh et al. Reference Meftouh, Harrat, Jamoussi, Abbas and Smaili2015; Bouamor et al. Reference Bouamor, Habash, Salameh, Zaghouani, Rambow, Abdulrahim, Obeid, Khalifa, Eryani, Erdmann and Oflazer2018). In addition, the regional dialects of Morocco, Libya, Sudan and Yemen have been handled in a more recent study by Zaghouani and Charfi (Reference Zaghouani and Charfi2018). Meanwhile, dialects of Saudi Arabia, United Arab Emirates, Kuwait, Oman, Qatar and Bahrain have been covered in a corpus created specifically for spoken dialects of the Arabian Peninsula (Khalifa et al. Reference Khalifa, Habash, Abdulrahim and Hassan2016). Another study carried out by Bouamor et al. (Reference Bouamor, Habash, Salameh, Zaghouani, Rambow, Abdulrahim, Obeid, Khalifa, Eryani, Erdmann and Oflazer2018) has established a corpus that encompasses a wide range of fine-grained dialects of 25 cities including Rabat, Fes, Algiers, Tunis, Sfax, Tripoli, Benghazi, Cairo, Alexandria, Aswan, Khartoum, Jerusalem, Amman, Salt, Beirut, Damascus, Aleppo, Mosul, Baghdad, Basra, Doha, Muscat, Riyadh, Jeddah and Sana’a. A recent paper by Abdul-Mageed et al. (Reference Abdul-Mageed, Zhang, Bouamor and Habash2020) has presented the findings of the First Nuanced Arabic Dialect Identification Shared Task (NADI). The corpus for the shared task covers a total of 100 provinces from 21 Arab countries and is collected from the Twitter domain, containing 30,957 tweets (Aloraini, Poesio, and Alhelbawy Reference Aloraini, Poesio and Alhelbawy2020). Despite the availability of the aforementioned resources, a great need for resources remains for a considerable number of fine-grained Arabic dialects and for more examples from different topics, domains and genres.
Althobaiti (Reference Althobaiti2020a, Reference Althobaiti2020b) has presented a recent comprehensive survey of the ADI task including available ADI annotated corpora. It is obvious that several studies have begun to address the shortage of annotated dialectal Arabic data by way of manual labelling, which costs effort and time, while others have utilised seed words to start collecting and annotating the data in a semi-automatic way. Indeed, these methods of annotation require previous knowledge of the target dialect. In our paper, we propose a novel approach that does not require deep previous knowledge of any Arabic dialect.
5. Construction of dialectal Arabic resources
Our corpus of dialectal Arabic texts is compiled from Twitter, representing the Arabic dialects spoken in 15 countries. The next subsection outlines our proposed approach to automatically create and annotate a dialectal corpus and also to construct word lists for various Arabic dialects.
5.1 General framework
Our approach to automatically build an annotated dialectal Arabic corpus and word lists depends primarily on the iterations of two main components: automatic creation of lists for dialectal words and automatic creation of annotated ADI corpus as illustrated in the general framework shown in Figure 1.
General framework used to automatically build an annotated corpus and word lists for Arabic dialects.

The first component, automatic creation of dialectal word lists, aims to provide a list of distinctive keywords for each dialect with no need for previous knowledge about that dialect. The distinctive word/keyword in the context of ADI is defined as the word used primarily in one Arabic variety, and so distinguishing it from others. For example, the distinctive Egyptian word (
, çAwz, ‘I want’) sets the Egyptian dialect apart from others. Distinctive dialectal words/keywords can be defined as the words used in one or more Arabic dialects but never used in MSA, thereby distinguishing Arabic dialects from MSA. Our algorithm starts with two corpora: the first one contains MSA sentences, which we call “MSA corpus” and the second contains mixed texts of MSA and different dialects (i.e., sentences written in various Arabic varieties such as MSA, Gulf dialects, Levantine dialects, Egyptian dialects, …etc). The second corpus can be collected easily and randomly from the web and social media sites, since their contents are informally generated by users and are currently considered the active resources providing dialectal Arabic texts. We call the second corpus ‘mixed corpus’. Given these two corpora, as well as Arabic WordNet, the first component in our framework extracts only distinctive dialectal keywords and classifies them into their corresponding dialects based on some text processing steps and weighting factors that will be explained in detail shortly.
The second component, automatic creation of an annotated ADI corpus, selects the top distinctive dialectal words based on weighting factors and uses them as seed words for collecting dialectal data. The iteration between these two components ensures the diversity of the collected dialectal corpus and its coverage of the maximum amount of vocabulary used in different topics and genres, while maintaining accuracy as much as possible.
6. Automatic creation of dialectal Arabic word lists
In this component, steps are followed through two modules: dialectal words extraction and dialectal words classification. The first module is to extract dialectal Arabic words from the mixed corpus by distinguishing them from MSA words regardless of their specific category (i.e., to which dialect each word actually belongs). The second module takes the responsibility of classifying the extracted dialectal words into a set of pre-defined dialects.
6.1 Dialectal words extraction
This module is used to automatically extract a list of dialectal words from mixed texts (e.g., data collected randomly from web texts, Facebook posts, Tweets and forums discussions). It starts with a set of three pre-processing steps: (a) text cleaning, (b) normalisation and (c) tokenisation. Text cleaning indicates the process of converting raw texts found on the web and social media sites into a form usable by NLP algorithms by removing diacritical marks, links, mentions from tweets, excessive spaces, emoticons, emojis, words less than two characters and stretched characters. Secondly, normalisation indicates handling the inconsistent variations when typing some Arabic letters. For example, different forms of alif may be written interchangeably. Another example is taa’ marbutah and haa’ which are usually used interchangeably in the final position of the word. The alif maqsurah and regular dotted yaa’ are also usually used interchangeably. Normalisation reduces noise and data sparsity by normalising different forms of alif into a bare alif (alif without hamzah), normalising taa’ marbutah to haa’ and normalising the dotless yaa’ (alif maqsurah) to yaa’. Tokenisation indicates simple tokenisation, which only splits off punctuation and non-alphanumeric characters from words.
Despite the fact that Arabic dialectal vocabulary sets differ from MSA and from each other, MSA words account for a considerable number of words in any Arabic dialect. For example, Harrat et al. (Reference Harrat, Meftouh, Abbas, Jamoussi, Saad and Smaili2015) analytically studied PADIC, a parallel corpus that covers five Arabic dialects, as well as MSA, and found that 51.68% of Palestinian dialect is actually MSA words, and the percentage of common words between the Syrian dialect and MSA is 37.36%. Therefore, the distinctive dialectal Arabic words (i.e., words used in one or more Arabic dialects but never used in MSA) can simply be extracted from any mixed texts by comparing words that exist in the mixed corpus with those in the MSA corpus. The words that are not found in the MSA corpus can be initially considered distinctive dialectal words. We selected two MSA resources for the purpose of comparing MSA contents to mixed contents. The first MSA resource is Arabic WordNet and the second is the MSA Wikipedia corpus. Therefore, after pre-processing the mixed texts and tokenising them, each word permeates through four filters to determine whether it is a dialectal Arabic word or MSA word, as shown in Figure 2. The comparison of MSA texts and mixed texts is conducted in the WordNet-based filter and Wikipedia-based filter. Normalisation is conducted in most ‘filters’, as illustrated in Figure 2, to help search for words in textual resources and extract sentences that contain them.
Algorithm of automatic extraction of dialectal Arabic words from texts.

In the WordNet-based filter, we utilised Arabic WordNet, a lexical resource for standard Arabic that contains synsets including verbs, nouns, adjectives, adverbs and named entities (NEs) (Abouenour, Bouzoubaa, and Rosso Reference Abouenour, Bouzoubaa and Rosso2013; Black et al. Reference Black, Elkateb, Rodriguez, Alkhalifa, Vossen, Pease and Fellbaum2006). Since Arabic WordNet is in lemma space and most words will not match, we employed a light stemmer to reduce inflected words to their lemmas. We utilised ‘Light Stemmer 10’ from AraNLP libraryFootnote
e
(Althobaiti, Kruschwitz, and Poesio Reference Althobaiti, Kruschwitz and Poesio2014a) with a slight modification. Light Stemmer 10 finds the word’s lemma by following many steps: (a) removing the conjunction (
) if the remainder of the word is three or more characters long, (b) removing any of the definite articles (
) if this leaves two or more characters and (c) removing any of the suffixes (
) that are found at the end of the word if this leaves two or more characters. We modified Light Stemmer 10 by adding a fourth step: removing any of the prefixes (
), if the remainder of the word is three or more characters long. The word will not be included in the list of dialectal Arabic words, once its lemma is found in WordNet. Even common words (in their inflected forms), which are used in both dialectal Arabic and MSA, disqualify as candidates for the list of dialectal Arabic words, once their lemmas are found in Arabic WordNet. This filter helps to exclude many MSA words, including common words used in both MSA and dialectal Arabic.
The contents of Arabic WordNet are manually verified, ensuring it is a reliable resource, but with limited size. The limited size of Arabic WordNet, especially in terms of adjectives and adverbs, led us to the second filter in which we used Arabic Wikipedia articles as an MSA corpus. That is, each word in mixed texts that can be found in Arabic WordNet are rejected for being MSA words, while those words that cannot be found in Arabic WordNet are further examined to confirm they are not MSA words by searching for their existence in another MSA resource (i.e., Arabic Wikipedia corpus). We prefer Arabic Wikipedia because it is an MSA corpus that is an open domain and represents different topics/genres. The words that cannot be found in the Arabic Wikipedia corpus are automatically included in the list of dialectal Arabic words. Table 2 shows examples of dialectal Arabic words that could not be found in either Arabic WordNet or the Arabic Wikipedia corpus, and therefore, were automatically added to the list of dialectal Arabic words.
Examples of Arabic words included in the dialectal Arabic lists after passing the WordNet and Wikipedia-based filters

The comparison of the MSA corpus to mixed texts is usually made in order to eliminate words shared between MSA and Arabic dialects, so as to extract only dialectal words that do not exist in MSA texts. Although this simple manner of distinguishing MSA words from dialectal ones in mixed texts is a straightforward intuitive solution, many available corpora for MSA contain dialectal words. According to Mubarak and Darwish (Reference Darwish2014), the commonly used MSA GigaWord corpus contains many dialectal words. They also found in their investigation that Aljazeera news articles contain many dialectal words, because these articles often contain quotes by people speaking in their own Arabic dialect. Aljazeera news articles also contain transcripts of interviews in which the interviewees occasionally use dialects. The corpus of Arabic Wikipedia articles is no exception, as it also contains some dialectal Arabic words within MSA sentences. Therefore, not every word found in the MSA Wikipedia articles is truly an MSA word.
The existence of dialectal Arabic words in MSA Wikipedia articles can be attributed to many factors. Firstly, some words are mistaken for MSA words, because their intended meaning is lost when taken out of context. For example, the dialectal Arabic word (
, mtAç), which is a particle indicating ownership or possession in Tunisian dialects, also functions as a noun meaning ’belongings’ in MSA, taking into account that the word is written without diacritical marks. Hence, the meaning of the word and the Arabic variety to which the word belongs cannot be predicted when it is out of context and written without diacritical marks, the usual case of written Arabic texts today. Secondly, some Wikipedia articles contain written dialogue and quoted speech in which the speakers/interlocutors and quoted people converse in Arabic dialects. Table 3 shows some examples from Arabic Wikipedia where the dialectal Arabic words appear within dialectal Arabic dialogue or quoted speech included in the MSA texts. In addition, we found that some dialectal Arabic words appear in Wikipedia articles as proper names (i.e., NEs). Table 4 shows examples of the dialectal Arabic words functioning as NEs in Arabic Wikipedia. Therefore, the existence of a word in MSA Wikipedia articles cannot be used as an efficient indicator that it is an MSA word.
Examples of dialectal Arabic contents in the Arabic Wikipedia corpus

Examples of dialectal Arabic words used as NEs in the Arabic Wikipedia corpus

The next two filters, MSA POS tagging and MSA Named Entity Recognition, deepen the examination of words from mixed texts that are found in MSA Wikipedia articles by determining whether the words are dialectal or not by using MSA POS tagging and MSA Named Entity Recognition. Firstly, we reimplemented the MSA NE recogniser in the study of Althobaiti, Kruschwitz, and Poesio (Reference Althobaiti, Kruschwitz and Poesio2014b) by adopting the same features which include (a) the words immediately before and after the current word in their raw and light-stemmed forms, (b) the first 1, 2, 3 and 4 characters in a word, (c) the last 1, 2, 3 and 4 characters in a word, (d) the appearance of the word in the gazetteer, and (e) the light-stemmed form of the word. The gazetteer employed contains around 5000 entries and was built by Benajiba, Diab, and Rosso (Reference Benajiba, Diab and Rosso2008). To find the light-stemmed form of the word, we removed the same affixes removed by Althobaiti et al. (Reference Althobaiti, Kruschwitz and Poesio2014b), namely conjunctions, prepositions and definite articles. Conditional random fields (CRFs)Footnote f were utilised to train the NE recogniser on an NE-labelled Wikipedia corpus called (WDC), which was made freely available by the aforementioned study. The use of the built NE recogniser allowed us to exclude many detected NEs in the mixed texts from the list of dialectal Arabic words. However, some real dialectal words, such as those illustrated in Table 4, have been mistakenly prevented from being added to the dialectal Arabic word list. The purpose of building a list of dialectal words is to classify its entries to create a list of distinctive words for each Arabic dialect and then use them as seed words to build corpora for Arabic dialects. Therefore, the precision of entries on the dialectal Arabic words list is more important in our study than the coverage of them. Thus, any word that is recognised in the MSA Wikipedia corpus to be a proper name is rejected from the list of dialectal Arabic words.
Regarding the dialectal Arabic words of the spoken dialectal Arabic dialogues that appear in written form within MSA sentences of Wikipedia articles as oulined in Table 3, we took into account the contextual information of the text by using MSA POS tagging. It is well known in the field of Arabic NLP applications that tools created specifically for MSA have a high likelihood of yielding poor results when applied on texts written in Arabic dialects (Duh and Kirchhoff Reference Duh and Kirchhoff2005; Habash et al. Reference Habash, Roth, Rambow, Eskander and Tomeh2013; Elgabou and Kazakov Reference Elgabou and Kazakov2017). We aim in our proposed method to exploit the poor performance of the MSA POS tagger on dialectal texts for the sake of extracting dialectal words. Hence, we investigated the behaviour of the MSA POS tagger on dialectal Arabic sentences. We found that dialectal words are often tagged as NNP by the MSA POS tagger, although they are not proper names and are not considered NEs by the NE recogniser. Further, in case, it is assigned more than one word class (POS tags) by the MSA POS tagger, then the dominant POS tag will be ‘NNP’. Also, we determined that if the dialectal word is not tagged as NNP by the MSA POS tagger, then the MSA POS tagger behaves inconsistently when it runs on a set of sentences that contain a dialectal Arabic word. The inconsistent behaviour is revealed when the MSA POS tagger assigns more than two possible POS tags to the dialectal word without an obvious dominant (most frequent) POS tag; this is unusual behaviour when applying the MSA POS tagger on the MSA contents. That is, most MSA words are tagged with one word class by the MSA POS tagger, and if it is tagged with more than one word class according to its role (position) in the sentence, then there will be a dominant (most frequent) POS, and the relative frequency of that dominant POS is usually greater than about 65%.
According to the investigation of the behaviour of the MSA POS tagger on dialectal Arabic contents, we set up a filter in our algorithm to extract dialectal words and distinguish them from MSA words as shown in Figure 2. Therefore, for each word from mixed text that is found in the MSA Wikipedia corpus and not considered an NE in the previous filter, we extracted the sentences in which that word appears from both MSA and mixed corpora, and then we applied an MSA POS tagger. The algorithm analyses and counts the possible word classes (POS tags) assigned to the word in all various sentences. Then, it applies the rules set in the ‘MSA POS tagger filter’ of our algorithm, which includes the following: (a) having more than one word class (POS tag) assigned to a word by the MSA POS tagger with a relative frequency of the dominant POS tag less than 65%, or (b) if the dominant POS tag assigned to the word is ‘NNP’, then this word has a high probability of being a dialectal Arabic word and therefore is regarded as a dialectal word. Details about the MSA POs tagger used and the investigation we have conducted to examine the behaviour of the MSA POS tagger on dialectal Arabic texts can be found in Appendix A.
6.2 Dialectal words classification
In this section, we explain the technique used to classify the list of dialectal Arabic words, created in Section 6.1, into 15 Arabic dialects at the country level. Table 5 shows the Arabic dialects covered in our study in order from eastern to western dialects. We used two factors in the classification process, the first of which is the geographical frequency factor that classifies the dialectal words in the list based on their appearances on Twitter. That is, dialectal words that appear in tweets generated by users living in Algeria, based on longitude and latitude of the tweets’ location, will be automatically classified as Algerian words and will be added to an Algerian word list. If the dialectal word appears in tweets generated by users in two different countries representing two different dialects (e.g., Tunis & Algeria), then the dialectal words should be added to the lists of both dialects. This is necessary because Arabic dialects share many common words. For example, the dialect word (
, šlwn, ‘how’) is used in Syrian, Iraqi and many Gulf dialects. However, people who live outside of their native country may set their location information on Twitter to indicate their current location. In addition, the geographical features of their tweets’ location (i.e., longitude and latitude information) may also indicate the users’ current location and not their native country. Therefore, words of their native dialect appear in their tweets and consequently, the use of geographical Twitter information as the only factor to classify any dialectal word into its dialectal category is insufficient. That is, some dialectal words appear in the tweets generated by expatriates representing their native dialects, even though the geographic information of the tweets represents the current country of residence. For example, the Yemeni distinctive word (
, Ašty, ‘I want’) appears in tweets of Yemeni Twitter (based on the longitude and latitude of the tweets’ location) but also appears in tweets generated by expatriates in Gulf countries. Hence, we cannot consider this dialectal word a common one between Gulf and Yemeni dialects. Native dialects tweeted from outside of their typical range cause words to be mistakenly added to the false words list. For this reason, we need a measurement that measures the significance value of each dialectal word to other dialectal Arabic categories. Therefore, our algorithm of classification uses the pointwise mutual information (PMI) measure as the second factor when the same dialectal word appears in tweets of different countries. Strong association between the dialectal word and the two dialectal categories indicates that the word is a common one between these dialectal Arabic categories and can be added to the word lists of both of them. Otherwise, the word will be added only to the dialectal Arabic category to which it has a strong association, according to the PMI score.
Arabic dialects covered in our study

6.2.1 Geographical frequency factor
In order to classify the list of dialectal Arabic words that is automatically collected, as described in Section 6.1, we exploited the geographic information of tweets generated by users daily on Twitter. Every tweet has a location (i.e., longitude and latitude coordinates) assigned to it based on where the user is at the time of the tweet. So, for each word in the dialectal Arabic list, we use the python library to access the Twitter API called tweepy Footnote g and collect as many tweets as possible that contain that word. The API provides access to the Twitter RESTful API methods and each method accepts various parameters and return response. We set up tweepy to collect data according to the geographical locations of areas that speak the 15 Arabic dialects covered in our study listed in Table 5. We also utilised the search method with its geocode and q parameters. The geocode returns tweets by users located within a given radius of the given latitude/longitude. The parameter value is specified by ‘latitude,longitude,radius’, where radius units must be specified as either ‘mi’ (miles) or ‘km’ (kilometres). We used kilometre as a radius unit. The q parameter is used for the search query string (Roesslein Reference Roesslein2020). After collecting the tweets containing the dialectal Arabic words, the algorithm automatically classifies each word based on the country/area in which it appears. Thus, the words that appear in tweets generated by users who live in Algeria and Tunis will be added to the Algerian and Tunisian word lists. This automatic process of classification revealed a notable percentage of overlap between different Arabic dialects, especially those spoken in adjacent countries. For example, North African countries share many dialectal words. By the end of this step, we managed to automatically create 15 word lists, one for each dialect. However, we added another factor to confirm the outcomes of the automatic classifying process of dialectal Arabic words.
6.2.2 PMI factor
PMI is a statistical measure of association strength between two events used in information theory (Manning and Schütze Reference Manning and Schütze1999; Su et al. Reference Su, Xiang, Wang, Sun and Yu2006; Isola et al. Reference Isola, Zoran, Krishnan and Adelson2014). It has proved to be an efficient association measure in a considerable number of NLP applications (Van de Cruys Reference Van de Cruys2011). Mathematically, the PMI of a pair of outcomes x and y belonging to discrete random variables X and Y measures the discrepancy between the probability of their coincidence given their individual distributions and joint distribution as follows:
In our study, we utilised PMI in order to evaluate how important a word is to a certain Arabic dialect by measuring the association between the word and that Arabic dialect. Mathematically, it is the log of the probability of the word occurring in a certain Arabic dialect divided by the product of the probability of the word and the probability of that Arabic dialect. Regarding the dataset on which we depend to calculate the probabilities, we used the initial data of tweets collected from Arabic Twitter, based on the list of dialectal Arabic words, and classified based on geographic information, as described in the previous section. So, let
$pmi(w;<dialect\_category>_{Tweets})$
be the PMI between a word w and tweets of a certain dialect (e.g.,
$Egyptain_{Tweets}$
,
$Saudi_{Tweets}$
) as follows:
where the probabilities p(w) can be computed by counting the occurrences of the word w in the dataset, while
$p(<dialect\_category>_{Tweets})$
is the number of the tweets written in a certain category of Arabic dialect (e.g., Egyptian (EG), Saudi (SA), Moroccan (MA), Tunisian (TN), Iraqi (IQ), …etc) in the dataset. The
$p(w,<dialect\_category>_{Tweets})$
represents the co-occurrences of the word w and dialectal tweets
$<dialect\_category>_{Tweets}$
in the dataset. The words with the highest PMI scores are more likely to appear in tweets of that specific category of Arabic dialect. That is, using PMI facilitates the ranking of the dialectal Arabic list according to their association’s degree to each Arabic dialect.
Furthermore, we ascertained that a distinctive word used primarily in a certain dialect yields a high PMI scores when computed with that particular dialect. For example, the Syrian distinctive word (
, bnwb, ‘never’) has a relatively high PMI when it is computed for the Syrian dialect, while the PMI of the word with other Arabic dialects, such as Egyptian or Gulf, is very low. Table 6 shows the PMIs for some dialectal Arabic words and the Egyptian dialect.
Examples of dialectal Arabic words and their PMI values for the Egyptian dialect

We can see that the Egyptian words have high and positive PMI scores, indicating the strong association between these words and the Egyptian dialect. The dialectal Arabic words of other categories such as Syrian, Tunisian and Iraqi words show negative PMI scores, which reflect the lack of relatedness between these words and the Egyptian dialect. To confirm the quality of the word lists of Arabic dialects, we decided to remove all dialectal Arabic words from a dialect’s list, if the PMI scores for these words were negative. So, in the case of the Egyptian dialect, as seen in Table 6, words with negative PMIs that appear in its list will be removed. In fact, we realise that all of the words with negative PMIs are not from the Egyptian dialect. For example, (
, mnyH, ‘good’) is a Syrian word that was tweeted from a location in Egypt. Words shared between Arabic dialects have relatively low PMI scores but never yield a negative score. For example, the dialectal Arabic word (
, mAfyš, ‘there is no’) is used in Egypt, Libya and Yemen. Therefore, the PMI of the word when computed for the Egyptian dialect
$pmi(w, EG_{Tweets})$
is low, as seen in Table 6. We decided to set a threshold for PMI to help specify the extent of relatedness for dialectal words. Setting a high minimum PMI value limits each dialect’s list of words only to distinctive keywords of that dialect, while also avoiding common words shared between one specific dialect and others as much as possible. The low minimum PMI value, on the other hand, would represent the opposite.
7. Automatic creation of dialectal Arabic corpus
After creating one word list for each of the 15 Arabic dialects as explained in the previous section, these lists can be used to gather data from online sources using the APIs that enable access to online data. We exploited the 15 word lists to collect the final dataset of dialectal Arabic from Twitter using the library tweepy to access the Twitter API. The quality of the lists is ensured using a PMI association measure that keeps only highly associated dialectal words in each category of Arabic dialects. For each Arabic dialect, the top words in its list are used as search keywords with Twitter API to return only tweets containing these words. The geocode parameter is also utilised in the query by providing the radius in kilometres and the longitude/latitude values of many cities in the country that speak this dialect in order to only return tweets by users located in that country. We set the query to target only tweets written in Arabic script. The collection process adds the extracted tweets to the corpus. This multi-level examination of the collected tweets starting from distinctive keywords, geographic information and kilometres radius helps increase the accuracy of returned data.
8. Experiments
The general framework of our approach to constructing dialectal Arabic resources, as shown in Figure 1, requires iterations. The algorithm starts with 5000 sentences of mixed texts collected randomly from the web, social media sites and forum discussions. The MSA corpus used in our experiments, as described in Section 5, is the 2014 Wikipedia dump,Footnote h containing 325,926 content articles. The Arabic WordNet that we utilised contains 11,269 synsets including 8737 verbs, 28,699 nouns, 771 adjectives and 269 adverbs. It also contains a total of 433,339 NEs (Abouenour et al. Reference Abouenour, Bouzoubaa and Rosso2013; Black et al. Reference Black, Elkateb, Rodriguez, Alkhalifa, Vossen, Pease and Fellbaum2006).
In the first iteration of the algorithm, 10 ‘seed’ words are used for each Arabic dialect. The number of ‘seed’ words in the next iteration will be equal to the number of ‘seed’ words in the previous one, plus one. The algorithm continues to increase the number of ‘seed’ words until the stopping point, when the number of returned new tweets is less than 5 for two consecutive iterations. We call our corpus ‘Twt15DA’ because it was built by adopting our algorithm that automatically collects and annotates dialectal Arabic tweets into 15 Arabic dialects. Our algorithm took 47 days on a PC with a CPU @4.01 GHz, 32.0 GB of RAM and 952 GB of an SSD hard disc.
The average number of dialectal words in the final 15 lists is 189. The largest number of dialectal words appears in the Algerian dialect list, which generated 418 words; on the other hand, the smallest number of dialectal words arose in the Omani dialect list, which produced only 76 words. We need to bear in mind that the algorithm computes the PMI value between a word and a potential dialect and considers the value as a degree to measure the relatedness between the word and the dialect. A high positive PMI value between a word and a particular dialect can reflect the strong relatedness between them (i.e., it is an excellent distinctive word primarily used in that dialect and rarely used in other dialects). A low positive PMI value between a word and a particular dialect suggests that the word is not unique to that dialect and is likely used in more than one dialect (i.e., it is a common word among two or more dialects). We decided to set a PMI value threshold of 0.1 or larger. This allows for each dialect list to include not only distinctive words, but also some common words shared between Arabic dialects in order to increase the coverage of the data collected for each dialect while maintaining accuracy. The PMI value we set affects the number of dialectal words in each dialect’s list. For example, many of the dialectal words collected from Oman Twitter are shared in common with dialects spoken in neighbouring countries, especially in Yemen and UAE. Consequently, some of these common words have PMI values less than 0.1, which may explain the number of dialectal words in the Omani list in comparison to the other 14 lists. We plan to make the final lists of dialectal words for the 15 countries availableFootnote i to the research community. Every word in each Arabic dialect list is mentioned along with its PMI score, representing the word’s degree of relatedness to that dialect. Appendix B presents some examples of words from the lists of various Arabic dialects.
Regarding our Twt15DA corpus in relation to Twitter’s Service Terms that restrict the distribution of tweet contents,Footnote j we plan to make the Twt15DA corpus availableFootnote k in a manner similar to the TREC Microblog Track (McCreadie et al. Reference McCreadie, Soboroff, Lin, Macdonald, Ounis and McCullough2012), releasing only User ID and Tweet ID pairs along with annotations. The User ID and Tweet ID can be used to crawl Twitter.
8.1 Characteristics of the dialectal Arabic corpus
This section presents some features of our automatically annotated corpus of dialectal Arabic ‘Twt15DA’. The corpus consists of 311,785 tweets containing 3,858,459 words in total, each of which is labelled as 1 category from the 15 Arabic dialect categories. Table 7 shows the distributions of each dialect in the corpus in terms of the number of tweets and the number of words.
Distribution of Arabic dialects in Twt15DA corpus

8.1.1 MSA dialect overlap
The analysis of the contents of the Twt15DA corpus shows that it contains many MSA words. These common words between MSA and dialectal Arabic make up 51% of the Twt15DA corpus. The Jordanian and Saudi dialects contain a large number of words in common with MSA, making up 53.44% and 53.08%, respectively, while the lowest percentage of common words is between the Moroccan dialect and MSA (40.77%). Table 8 shows overlap percentages between each Arabic dialect on the one hand and MSA on the other hand.
MSA dialect overlap percentages in the Twt15DA corpus

The words shared among MSA and dialectal Arabic can be divided into four types:
-
Complete similarity (same written form, same pronunciation and same meaning): These words are written in the same way in MSA and dialectal Arabic. They also have the same meaning and they sound alike. For example, the word (
, maç, ‘with’) exists in MSA and all Arabic dialects. It is also pronounced the same way in all Arabic varieties including MSA
. -
Partial similarity (same written form, different pronunciations and same meaning): These words have the same written form and the same meaning. However, they have different vocalisation, leading to different pronunciation. For example, the word (
,
, ‘He lied’) in Arabic dialects and MSA have the same written form and the same meaning ‘He lied’. However, the word is pronounced differently. Hence, in some Arabic dialects, the word is pronounced
, while in MSA it is pronounced as
. Indeed, the pronunciation of the word is obvious with diacritical marks (e.g., in Arabic dialect
while in MSA,
). As diacritical marks are rarely used when writing Arabic, especially in online contents such as social networking sites, the non-vocalised words (i.e., words without diacritical marks) cannot be used to determine the Arabic variety of the word. -
Complete homonyms (same written form, same pronunciation and different meanings): These words are written in the same way in MSA and Arabic dialects, sound alike, but have different meanings. For example, the word (
, bAhy) is written the same in both MSA and the Libyan dialect and is pronounced the same. However, the word (
) in Libyan dialect means ‘yes/OK’ while in MSA, it means ‘bright/brilliant’. -
Partial homonyms (same written form, different pronunciations and different meanings): These words have the same written form, but different meanings and pronunciations. For example, the word (
, mtAç) without diacritical marks means ‘belongings/goods’ in MSA, while in the Tunisian dialect this word is a particle that is used to express ownership or possession (e.g., (
‘the book is mine’). In addition to different meanings of the word in MSA and the Tunisian dialect, the word is pronounced differently
in the Tunisian dialect than
in MSA.
8.1.2 Inter-dialect overlap
Common words are not found only between dialectal Arabic and MSA, but also among various Arabic dialects on different levels. Figure 3 shows the percentages of common words among Arabic dialects (i.e., the inter-dialect overlapping results for each pair of 15 Arabic dialects), taking into account these overlap percentages are in type (unique) space. That is, some Arabic varieties do not have online morphological analysers at all and other Arabic varieties have premade morphological analysers, but they are often neither available online nor freely available, as discussed in Section 3.1. Therefore, when matching the words of two Arabic varieties to identify which overlap, we did not analyse these words morphologically beforehand. That is, we kept clitics and affixes attached to the words. This must have affected the percentage of overlap between Arabic varieties, as the matching also included the clitics and affixes. However, the proportionality between the obtained results are logical and represents the reality. Clearly, the results in Figure 3 indicate that the less the geographical distance between the Arabic dialects, the greater the number of common words between them. Thus, Arabic dialects spoken in the Maghreb region share many common words among them but have less words in common with dialects spoken in the Middle East. For example, the percentage of overlapping words between the Tunisian and Algerian dialects (spoken in Tunis and Algeria, two adjacent countries in North Africa) is 19.50%, while the percentage between Tunisian dialect and Omani dialect (spoken in Arabian Peninsula) is 9.73%.
Overlap percentages among dialects in the Twt15DA corpus.

The common words among various Arabic dialects can be one of four types: (a) complete similarity where two words from two different Arabic dialects have the same written form, the same pronunciation and the same meaning, (b) partial similarity that indicates the state of similar written form and meaning, but different pronunciations, (c) complete homonyms where two words are written in the same way in two Arabic dialects and sound alike but have different meanings, and (d) partial homonyms where the words shared between two Arabic dialects have the same written form, but different meanings and pronunciations. Table 9 presents some examples of different types of common words among Arabic dialects.
Types of common words among various Arabic dialects

8.1.3 Tweet and word sizes
In the Twt15DA corpus, tweets contain on average 12 words. The longest tweet in the corpus contains 46 words, while the shortest consists of 2 words. Additionally, the average word in the Twt15DA corpus contains four characters in tweets that include both MSA and dialectal Arabic. On the other hand, in dialectal Arabic lists, which contain only dialectal Arabic words, the average dialectal words consists of six characters. Detailed information regarding tweet size and word size for each Arabic dialect in the corpus is presented in Table 10.
The tweet size and word size for Arabic dialects in Twt15DA corpus

9. Evaluation
In order to evaluate the annotated dialectal Arabic corpus, Twt15DA, that was built and annotated using our proposed algorithm, we randomly selected a sample of 75 tweets per country (i.e, 1125 tweets in total). Following the work of Bouamor et al. (Reference Bouamor, Hassan and Habash2019) and the work of Abdul-Mageed et al. (Reference Abdul-Mageed, Alhuzali and Elaraby2018), we conducted a manual dialect identification task by human annotators and computed the inter-annotator agreement.
The annotation process involved providing each annotator with the tweets representing a single country at a time. We asked the annotator to choose whether a tweet represents the dialect of the given country or another dialect (i.e., they selected YES or NO). In the case of ‘NO’, we did not ask annotators to specify what other dialect they think the tweet belongs to in order to simplify the process of annotation (Abdul-Mageed et al. Reference Abdul-Mageed, Alhuzali and Elaraby2018) as shown in Figure 4.
Manual dialect identification by human annotators - Egyptian dialect.

The human annotators who labelled the sample of the 1125 tweets are 25 college-educated native Arabic speakers. We asked each annotator about their native Arabic dialect, and their current country of residence. Each tweet was labelled by two annotators. In all cases, we ensured that at least one of the annotators is originally from the country from which the tweets are derived, whereas the second annotator could originate from a directly neighbouring country. For example, the tweets derived from Kuwaiti Twitter were manually labelled by one annotator whose native dialect is Kuwaiti and another annotator for whom the Saudi dialect is their native tongue (the second annotator is from the eastern part of Saudi Arabia, close to Kuwait). In order to deeply evaluate tweets derived from countries close to each other, we decided to allow assigning annotators to evaluate tweets of directly neighbouring countries. This decision prevented bias because it is challenging to differentiate between dialects of adjacent countries/areas, especially in short sentences like tweets. For example, this short tweet written by a Qatari user of Twitter (
) contains two dialectal words: (a)
usually used in most adjacent Gulf countries and (b)
used in UAE and Qatar. These overlapping terms confused the annotator from the UAE when asked whether this tweet is written in the Qatari dialect. In that annotator’s opinion, the tweet could also represent the Emirati dialect. Therefore, accepting annotators from adjacent countries helped us highlight such cases.
Each tweet was labelled by two annotators. The level of agreement between annotators was assessed using a Cohen’s kappa (K) statistical test based on their answers (YES or NO) (Landis and Koch Reference Landis and Koch1977). Table 11 shows that the average Cohen’s Kappa (K) is about 64%, which generally reflects good agreement. The annotators agreed with a high K equal to 80% on tweets derived from Egyptian and Jordanian Twitter. The annotators also showed a substantial agreement with K equal to around 79% on Saudi tweets. There were also substantial agreements between annotators with a K value equal to 72% on tweets derived from Syria and Iraq. Regarding tweets from Libya and Kuwait, the annotators agreed with K values equal to 65% and 63%, respectively. For the tweets derived from the remaining eight Arabic countries, the annotators agreed moderately with K values range from 52% to 59%.
Inter-annotator agreement for the human dialect identification task (Average of K values is 0.64)

The first note regarding the results of the human dialect identification task is the very high values of Kappa K, greater than 70%, on tweets from Jordan, Egypt, Saudi Arabia, Syria and Iraq. This can be attributed to the fact that tweets in the Twt15DA corpus extracted from these countries usually contain distinctive words and/or distinctive word order (i.e., a combination of common words among Arabic dialects in a ‘distinctive’ order). For example, if we take the following three words into account: (a)
, an MSA word used in almost all Arabic dialects which means ‘for you’, (b)
, a dialectal word used in Levantine area (e.g., Syria) which mean ‘this’, and (c)
is a dialectal word used in the Gulf region which means ‘what’. The combination of these words in the following order
which means ‘you, what is this!’ can be easily predicted as a phrase used in Iraq. Intriguingly, Iraq is geographically located between Levantine and Gulf regions and this may be the reason for having a distinctive phrase or word order consisting of some words from the Levantine region and some from the Gulf region. We realised that even the short tweets (have
$<$
5 words), which contain common words among dialects but have distinctive word order, are more likely to be easily identified by annotators and to yield substantial agreement on the dialect identification decisions made by them.
The annotators achieved moderate agreement
$<$
0.60 for tweets from many Arabic countries such as Yemen, Oman and Algeria as outlined in Table 11. The annotators struggled to identify the dialects of many short tweets, since they contained words shared among dialects and lack distinctive features (i.e, distinctive words, phrases, words’ order). We analysed the length of the tweets about which the annotators disagreed, and the average length of the tweets was nine words. The longest tweet with disagreement between annotators about its dialect consisted of 22 words and the shortest consisted of 2 words. For example, the shortest tweet was (
‘OK, you comfort me’) and appeared among Libyan tweets. Both annotators disagreed on this tweet; the Libyan annotator correctly identified the tweet as Libyan, whereas the second annotator, who originates from Tunis, recognised the words from their dialect and believed the tweet could be Tunisian. These short tweets did not contain distinctive features that would clarify the author’s dialect.
Some of the longer tweets of more than nine words on which the annotators disagreed in fact contain distinctive words but cause confusion because they contain a mix of distinctive words used in geographically non-adjacent dialects (i.e., dialects spoken in non-adjacent countries). For example, the co-occurrence of the Egyptian word (
, çAwz,‘I want’) and Gulf word (
, Sdj, ‘honestly’) in the same tweet caused confusion among the annotators. Clearly, tweet authors sometimes quote the direct speech, exact words in their original forms and dialectal utterances, of speakers of different dialects than the tweet author themself. For example, one tweet in our Twt15DA corpus that was identified as the Kuwaiti dialect (
) contains a number of words from the Egyptian dialect (
), but the tweet also contains words only utilised in some Gulf countries (
). Another example of a tweet quoting direct speech in a dialect that differs from that of the tweet’s author is (
). In addition, some rare cases exist where the tweet author deliberately writes a mix of distinctive words from different dialects. This phenomenon affects some Arabic dialects in our Twt15DA corpus and causes confusion and disagreement among annotators. For example, there is a tweet annotated as Kuwaiti in our corpus (
) whose author, according to his profile page, resides in Kuwait. The author’s location is also confirmed by the longitude and latitude of the written tweet. Almost all of his tweets are written in the Kuwaiti dialect which gives us reason to believe that he intentionally included an Egyptian word (
, çAwzhA, ‘you want’) in the aforementioned tweet.
We analysed the tweets rejected by both human annotators and can summarise them into two categories: (a) MSA tweets that are mistakenly included in the corpus due to spelling errors by the tweets’ writers and non-standardised orthography of online user-generated content, and (b) unnatural tweets that contain distinctive words from two or more non-adjacent dialects. An example of the first case is the MSA tweet (
) which contains a misspelled word (
) resulting from mistakenly replacing a letter (
) with the letter (
). This spelling error and inconsistent orthography convert the MSA word (
) to the abbreviated Gulf word (
, ‘now’) from the Gulf word (
) and therefore, the tweet was mistakenly collected by our algorithm. Regarding unnatural tweets that contain distinctive words from two or more non-adjacent dialects, many of these tweets do not represent a conversation containing direct speech, as explained previously, and this creates more confusion. Both annotators usually reject such tweets when conducting manual dialect identification. Some examples of these tweets are (
) and (
). We found that the average length of the rejected tweets is equal to 13 words. The shortest rejected tweet contains five words, while the longest rejected tweet is 30 words.
10. Conclusion
This paper described our novel approach to automatically constructing annotated resources for dialectal Arabic from online contents. The general framework of our method depended primarily on the iterations of three main components: automatic creation of lists for dialectal words, selection of seed words and collection of dialectal sentences. The method exploited the poor performance of available NLP tools trained specifically on MSA contents when applied on dialectal contents. Indeed, our study intensively investigated the poor performance of the MSA POS tagger on dialectal Arabic contents and analysed the results. Then, our algorithm took advantage of that poor performance of the MSA POS tagger on dialectal Arabic content an its inconsistent behaviour in order to extract dialectal Arabic words and distinguishing them from MSA words. To classify the dialectal words into 15 Arabic dialects, our method depends on the PMI association measure and the geographical frequency of word occurrence according to the longitude and latitude of a word’s appearance in social media platforms.
Twitter was utilised as a case study in which we applied the proposed method. We managed to build a corpus ‘Twit15DA’ consisting of 311,785 tweets and 3,858,459 words in total. The dataset covers 15 Arabic dialects spoken in an area that stretches from Morocco in the west to Oman in the east, in the Middle East and North Africa. Our paper also analysed the dataset to study its characteristics, such as overlapping words and average sizes of examples and words. In order to evaluate our study, we randomly selected a sample of 75 tweets per country (i.e, 1125 tweets in total). We conducted a human dialect identification task and computed the inter-annotator agreement. Each tweet was labelled by two human annotators. The level of agreement between annotators was assessed using a Cohen’s kappa (K) statistical test where the average Cohens Kappa (K) for all dialects is equal to 64%, which generally reflects satisfactory agreement. This method proved to be effective.
For each Arabic dialect, the use of the PMI measure along with the geographical frequency of word occurrence helped to obtain solid results by selecting only words that are commonly used in that dialect and rarely or never in another dialect. The threshold we set for PMI values also helped to specify the extent of relatedness of dialectal words to a target dialect. Setting the PMI minimum to a high value ensures that, as much as possible, only distinctive dialectal words are included on the target dialect’s word list, while common words between the target dialect and others are avoided as much as possible. A low minimum PMI threshold would result in the opposite. Therefore, we set a threshold of PMI values greater than 0.1.
The results of the ADI conducted by human annotators to evaluate our built corpus indicated that some short sentences (tweets) collected using our automatic approach baffled the annotators, because they contained only common words and no distinctive words. In future research, more investigation should be conducted regarding the PMI threshold and overall coverage of the collected data. In addition, the tweets that were rejected by both annotators are generally short in length and contain a mix of distinctive words from non-adjacent dialects, as previously explained. Therefore, a number of improvements may further enhance the precision of our algorithm, including the incorporation of more restrictions over the collected lists of dialectal words and their PMI values. One potential restriction to be imposed is the rejection of tweets of a certain dialect if they contain a word with a high PMI value for another dialect. Adding such restrictions can also prevent tweet that represent conversations containing direct speech from being included in our corpus. In addition, we plan to examine our algorithm for city-level Arabic dialects. We may also exploit the web (e.g., reviews of online products, health forums and education discussion groups) as a source of collecting data, along with Twitter as a source of possible features utilised by our algorithm (e.g., Twitter meta data, the information from the author’s profile, and the latitudes and longitudes of tweets containing certain words). We believe that using the web along with Twitter will return more balanced results with improved accuracy and a wider coverage of topics, even for finer-grained dialects.
Acknowledgements
We would like to express our gratitude to the anonymous reviewers as well as the editors for substantial, insightful and constructive feedback in the first and second rounds of revisions. Their comments and critical reviews have helped us make major improvements to the article.
Appendix A. Comparative Study of MSA POS Tagger Performance on both MSA and Dialectal Contents
We explain in what follows our investigation of the performance of the MSA POS tagger on both the dialectal contents and MSA contents. We used the AraNLPFootnote l library (Althobaiti et al. Reference Althobaiti, Kruschwitz and Poesio2014a), which incorporates the Stanford Arabic word segmenter and POS tagger. In the AraNLP library, word segmentation is conducted automatically before POS tagging. That is, in AraNLP, the use of the MSA POS tagger first requires performing the segmentation and second, performing the POS tagging. The segmenter produces the three Penn Arabic Treebank (PATB) clitic segmentations: conjunctions, pronouns, and prepositions. Please note that the purpose of the experiments and manual investigation of the results carried out in this section is only to study the behaviour of the MSA POS tagger in order to find the shortcomings that are exposed when applied to dialectal Arabic contents. We take into account the main grammatical categories (i.e., verb, noun, adjective, adverb, proper noun, particle, conjunction, preposition, detached pronoun, and cardinal number), neglecting information that covers inflectional features such as case, number, aspect, person, and voice.
A.1 A pilot investigation
We initiated our investigation by collecting the contents of the MSA and dialectal Arabic that are used in this section. For MSA contents, we manually created a list of 150 MSA words from the Dictionary of the Modern Arabic LanguageFootnote
m
. Then, Arabic Wikipedia articles were used to randomly collect 120 sentences for each word in the list, resulting in the collection of 18,000 MSA sentences in total. The MSA POS tagger was used to assign a word class (POS tag) to each word in all of the 120 sentences in which it appeared. We analysed the outcome of the POS tagging process and observed that a percentage of the MSA words (53 out of 150) were classified under several word classes (POSs), since these words were used in different roles and positions in the sentences containing them. For example, the Arabic word (
,
) has two meanings ‘went’ or ‘gold’. As a result, the MSA POS tagger assigned two word classes to this word, noun and verb, based on its position and role in the sentences. On the other hand, a considerable percentage of MSA words (97 out of 150) were actually classified under one POS. For example, the MSA Arabic word (
, Altçlym, ‘education’) was classified by the MSA POS tagger as a noun in all of the 120 sentences containing it. The same is true for the word (
, qrÂ, ‘read’), which was classified as a verb. Table A1 shows some MSA words and their results after applying the MSA POS tagger on the sentences that contain them.
The results of the MSA POS tagger for some MSA words

For each word in Table A1, the columns illustrate the set of POS tags (POSs) assigned to the word by the MSA POS tagger in decreasing order and their respective frequencies. The table also shows the dominant (most frequent) POS tag assigned to the word and the relative frequency of the dominant POS versus the total frequency. Taking into consideration that the word classes (POSs) are assigned automatically using the pre-made MSA POS tagger, we expect a proportion of inaccuracy in the tagging process. We manually analysed the results of tagging 30 MSA words in 3600 sentences containing them. The performance analysis of the tagger’s results, performed by a native Arabic speaker, exhibited high accuracy of 88%. We found that POS tagging errors mostly appear in the words that have more than one meaning. For example, the MSA word (
, dxl) which is written without diacritical marks, has two meanings: ‘income’ and ‘entered’. Therefore, this word can be tagged as a noun or a verb by the trained MSA POS tagger based on the context. During the analysis process, we found that the word (
, dxl) was tagged in error as a noun while it is a verb.
Furthermore, a small number of errors occurred for MSA words that have one meaning, regardless of their context. For example, the word (
, AlçAlmy, ‘global’) was once classified by the MSA POS tagger as a noun in the sentence (
…, ‘Garcia Marquez’s global fame began when he published …’). However, the dominant POS tag assigned to this word was adjective in 119 out of 120 sentences containing it.
As for dialectal Arabic contents, we manually navigate the online discussion forum, posts on social media sites. We managed to manually collect 10 words for each one of the 15 dialects in this study, resulting in a list of 150 dialectal Arabic words. Then, we randomly collected 120 sentences containing these words from the web, building a dataset of 18,000 sentences containing various dialectal Arabic words. The MSA POS tagger was used to tag the sentences in the dataset. The results of applying the MSA POS tagger on dialectal contents were analysed based on the POS tags assigned to each dialectal word in all sentences, the frequencies of these POS tags, the most frequent POS tag, and its relative frequency versus the total frequency. Table A2 shows some dialectal words and their results when applying the MSA POS tagger on the sentences that contain them.
The results of the MSA POS tagger for some dialectal Arabic words

Our first observation from Table A2 is the very low accuracy of the MSA POS tagger performance on dialectal contents. This performance is to be expected, since the Arabic POS used in our study was actually trained on written MSA newswire files from news agencies (Toutanova and Manning Reference Toutanova and Manning2000; Toutanova et al. Reference Toutanova, Klein, Manning and Singer2003). Truly, the MSA contents and dialectal Arabic texts have a considerable number of differences at all levels of language (Versteegh Reference Versteegh2014; Zaidan and Callison-Burch Reference Zaidan and Callison-Burch2014). We analysed the results of applying the MSA POS tagger on dialectal Arabic texts in order to exploit the shortcomings as a way to distinguish dialectal words from MSA words based on the effects of the MSA POS tagger on both as described in Section 6.1.
To evaluate the MSA POS tagger’s performance on dialectal contents, we employed a native Arabic speaker with a solid, well-rounded knowledge of Arabic dialects. The native speaker was given 30 dialectal words and 3600 sentences containing them, which were tagged by the MSA POS tagger, as we described before. The manual evaluation shows an accuracy of 21.05% achieved by the tagger. Around 67.27% of the dialectal words were classified in many sentences containing them as proper nouns ‘NNP’ although they are common words, an obvious mistake that can be considered a shortcoming of the MSA POS tagger on dialectal contents.
A small percentage of the dialectal Arabic words (16 out of 150) were classified as one word class, while most of the dialectal Arabic words (134 out of 150) were classified under several word categories and most of these tags were incorrect. For example, the dialect word (
, hAd, ‘this’) was classified under three incorrect word categories (‘NN’, ‘NNP’ and “VB”) by the MSA POS tagger. We also found that the dominant POS tag assigned to any dialectal Arabic word, in fact, had a relative frequency less than 0.65 versus the total frequency for all the POSs assigned to that word. For example, The Egyptian word (
, çAyz, ‘I want’) was assigned four POS tags by the tagger. These four POS tags are ‘NN’, ‘JJ’, ‘NNP’ and ‘VB’ and their frequencies in the 120 sentences containing it are 57, 28, 23 and 12, respectively. This makes the relative frequency of the dominant POS tag ‘NN’ versus the total frequency of the whole POSs is equal to 0.48. Figure A1 shows the counts of dialectal Arabic and MSA words versus the number of word classes assigned to them.
Counts of dialectal Arabic and MSA words versus No. of word classes assigned to them.

A.2 Investigation on parallel corpus
As was previously stated, the MSA POS tagger used in our investigation was trained on written MSA newswire files from news agencies. The MSA contents used in the investigation described in previous section were collected from Wikipedia and the dialectal Arabic contents were collected from the web (e.g., online discussion forums, posts on social media sites). This may raise suspicion that the failures/errors of the MSA POS tagger on dialectal Arabic are based on the difference in genre/domain between MSA and dialectal Arabic contents. Moreover, both of the MSA texts utilised in the investigation and news texts used in training the POS tagger are mostly in third person, while the dialectal Arabic contents used in the investigation tend mostly to be in first and second person, since they were collected mostly from social media sites. Therefore, this section was dedicated to investigating the performance of the MSA POS tagger on the parallel corpus of MSA and various Arabic dialects.
We employed the Multidialectal Parallel Corpus of Arabic (MPCA) (Bouamor et al. Reference Bouamor, Habash and Oflazer2014) that contains 2000 parallel sentences and covers MSA, as well as 5 dialects: Egyptian, Tunisian, Jordanian, Palestinian and Syrian Arabic. The authors created the corpus by selecting the sentences from the Egyptian part of the Egyptian-English corpus built by (Zbib et al. Reference Zbib, Malchiodi, Devlin, Stallard, Matsoukas, Schwartz, Makhoul, Zaidan and Callison-Burch2012), then they asked four translators (native speakers of Jordanian, Palestinian, Syrian and Tunisian) to translate the 2000 sentences written in Egyptian into their dialects. They also asked a fifth translator to translate the same text into MSA. These sentences were harvested from the web, largely from weblog and online user groups.
We decided to use the MPCA corpus in the investigation of the MSA POS tagger performance on both MSA and dialectal contents for several reasons, not the least of which is that a parallel corpus would prevent our investigation from being affected by the genre/domain/topic bias of the datasets. In addition, the MPCA corpus contains sentences collected from the web and most of its contents tend to be in first and second person, including those sentences written in MSA, which makes the comparative study fair. The corpus is also freely available and contains a considerable number of sentences, covering a fair number of Arabic dialects, as well as MSA.
To evaluate the performance of the MSA POS tagger on the MSA contents, we randomly selected 50 words from the MSA portion of the MPCA corpus. We wrote a script that extracts the sentences containing these words from the MSA portion of the MPCA corpus and then assigned to each word in every sentence a POS tag using the MSA POS tagger (use of the POS tagger incorporated in AraNLP library first requires applying the segmenter as previously described). Manual evaluation of the outcome of the POS tagging process showed that 42 words out of 50 were actually classified under one word class (POS). Only 9 words out of 50 were classified under two word classes (POSs) in the sentences containing them, as these words have 2 meanings based on their roles and the contexts in which they appear. Table A3 shows some MSA words and their results after applying the MSA POS tagger on the sentences that contain them.
The results of the MSA POS tagger for some MSA words in the parallel corpus

The behaviour of the MSA POS tagger on the MSA portion of the MPCA corpus is the same when applied on text from Arabic Wikipedia articles (in previous section). That is, the MSA POS tagger, when applied on MSA contents, usually assigns one word class (POS tag) to a word in all sentences containing it. If the word has more than one meaning based on the context and its position in the sentence, then the MSA POS tagger assigns two POS tags, or sometimes three, in all sentences containing it. We also realise that there should be a dominant POS tag and the relative frequency of the dominant POS tag is usually more than 65% as is evidenced in Tables A1 and A3.
The performance analysis of the tagger’s results, conducted by a native Arabic speaker, showed a high accuracy of 85%. However, the increase of 3% in accuracy achieved by the MSA POS tagger on texts from Wikipedia articles can be attributed to the difference in domains. In addition, the MSA portion of the MPCA corpus was composed of sentences produced by translating original Egyptian sentences into MSA. The quality of translation of some sentences does not convey the original meaning. Moreover, the sentences also contain some spelling errors, as well as errors in MSA vocabularies (i.e., use of Egyptian words instead of being translated purely into MSA). For example, the Egyptian word (
, GlbAn, ‘poor’) is used in Egyptian sentences. The translator used the same Egyptian word for ‘poor’, rather than using the accurate MSA term, and thereby produced an awkward sentence. The Egyptian sentence is
, while the MSA translation of the sentence is
.
Regarding dialectal Arabic, we randomly selected 50 words from the dialect portions of the MPCA corpus: 10 words for each dialect of the 5 dialects covered by MPCA. Next, we ran our script to extract the sentences containing these words from the MPCA corpus. The MSA POS tagger was then used to assign word classes (POS) to each word in all sentences containing them. Table A4 shows how the MSA POS tagger performs on dialectal Arabic contents from the parallel corpus.
The results of the MSA POS tagger for some dialectal Arabic words in the parallel corpus

We analysed the results of the MSA POS tagger on dialectal contents of the MPCA. Around 64% of the words (32 out of 50) were classified as proper nouns in some sentences although they were common nouns, adjectives or verbs. This exposed the imperfect performance of the MSA POS tagger when applied to dialectal Arabic contents. In addition, the MSA POS tagger’s behaviour was unstable, as the same word in various sentences was classified under more than two word categories (POS tags) and most of these tags were incorrect, as described in Table A4. Figure A2 shows the counts of dialectal Arabic words versus the number of possible word classes assigned to them when the MSA POS tagger was applied to the MPCA corpus.
Counts of dialectal Arabic and MSA words versus No. of possible word classes in the parallel corpus.

A native speaker with strong knowledge of Arabic dialects was given the outcome of the MSA POS tagger on dialectal contents. Their manual evaluation showed an accuracy of 16.12% achieved by the tagger. This result confirmed that the MSA POS tagger performs imperfectly on dialectal Arabic contents.
The investigation using a parallel corpus and the errors of the MSA POS tagger on dialectal Arabic contents proved that these failures were a result of the differences between MSA and the dialectal Arabic contents on all linguistic levels and not due to the domain/genre differences. The source of the MSA POS tagger’s failures when applied to dialectal Arabic contents versus MSA contents was obvious, since the errors persisted, even when the tagger was applied on the parallel corpus that contained both MSA and dialectal content. One challenge faced by the MSA POS tagger when dealing with dialectal Arabic was the use of clitics and affixes that do not exist in MSA. For example, the affixes (
and
) that indicate the future particle contrast the affix used in MSA (
). Another significant challenge was the circumfix negation (
) that surrounds some verb forms in Egyptian but is not present in MSA. These new clitics could not be processed perfectly by the MSA POS tagger used in our study nor by the MSA segmenter used implicitly before applying the POS tagger, as explained above.
Appendix B. Examples of Words from Dialectal Arabic Lists
Examples of words and their PMI values from the 15 dialectal Arabic lists automatically collecting in our study





















