Arabic dialects, Arabizi and code-switching

Arabic Dialects, Arabizi and Code-Switching

The phenomenon of diglossia, the classification of Arabic dialects, the challenges of processing them (no standard spelling, scarce resources), the task of dialect identification at the country and city level, writing Arabic in Latin letters (Arabizi) and switching between languages.

Lesson 10 of 38Intermediate35 minutes

Lesson objectives

  • Describe diglossia and its effect on processing.
  • Know the levels of dialect identification and their datasets (MADAR and NADI).
  • Understand the problems of Arabizi and code-switching and how to handle them.
Page contents
  1. Diglossia
  2. Map of the dialects
  3. Challenges of processing dialects
  4. Dialect identification
  5. Arabizi
  6. Code-switching

Diglossia

Ferguson (1959) described diglossia as the existence of two varieties of the same language in a society: a high variety learned at school and used in writing and formal situations (MSA), and a spoken variety acquired at home and used in daily life (the dialects). Dialects were rarely written, but social media changed that: tweets, comments and messages are now written in dialect, and they are the most important source of modern data.

Map of the dialects

Arabic dialects are traditionally classified into regional groups, with great internal diversity:

GroupExamplesDistinctive feature
Egyptian and SudaneseCairene, Saidi«مش», «إزيك», pronouncing jim as a voiced g in Cairo
LevantineSyrian, Lebanese, Palestinian, Jordanian«شو», «هيك», «بدّي»
GulfSaudi, Kuwaiti, Emirati…«وش», «شلون», «زين»
IraqiBaghdadi and others«شكو ماكو», «هواية», «اكو»
MaghrebiMoroccan, Algerian, Tunisian, Libyan«واش», «بزاف», influenced by Amazigh and French
YemeniSanaani and othersPreserved archaic features

But the boundaries are not sharp: dialects form a continuum, and they vary within the same country between cities, rural areas and social groups.

Challenges of processing dialects

  1. There is no standard spelling: “هلق”, “هلأ” and “هلّأ”; researchers propose the CODA convention to standardize dialect orthography.
  2. Scarce resources: lexicons and annotated corpora are few compared with MSA.
  3. Overlap: most vocabulary is shared with MSA, and distinctive features are few in short text.
  4. Different morphology: “ما كتبتلوش” (Egyptian) = ما + كتبت + لـ + و + ش: a compound negation that an MSA analyzer does not know.
  5. Model performance: models trained on MSA drop clearly on dialects, which is why models pretrained on tweets, such as MARBERT, appeared.

Dialect identification

Dialect identification is a classification task: given a text, what is its dialect? The required granularity varies:

  • Region (5–6 classes).
  • Country (about 18–21 classes).
  • City or province: the MADAR project (Bouamor et al., 2018) provided parallel sentences translated into the dialects of 25 Arab cities in addition to MSA.

The NADI series (since 2020) organized shared tasks on country-level and province-level dialect identification from tweets. Lessons that emerged from them include:

  • Features at the level of character n-grams are very strong because they capture distinctive affixes and spelling.
  • Models pretrained on dialectal data (MARBERT and the like) achieve the best results.
  • Fine-grained identification is hard, especially between neighboring dialects, and the usual metric is Macro-F1 because of class imbalance.
  • Some sentences are valid in several dialects, which later led to formulating the task as multi-label classification or as estimating a "level of dialectness" instead of a single class.

Arabizi

Arabizi is writing Arabic (mostly dialects) in Latin letters and digits; it spread with phones that did not support Arabic. Digits are used to represent letters that have no Latin equivalent:

DigitCharacterExample
2ء / ق (in some dialects)so2al = سؤال
3ع3arabi = عربي
5 or 7'خ5alas = خلاص
7ح7abibi = حبيبي
9ص or ق (depending on the region)9aba7 = صباح

Processing Arabizi requires detecting Arabizi text (distinguishing it from English or French), then transliterating (Transliteration) it into Arabic letters, an ambiguous task because vowels are not represented consistently and spelling varies between people. Darwish (2014) used character models and a language model to choose the most likely transliteration.

Code-switching

Code-switching is mixing two languages in the same sentence: “عندي meeting بعد الـ lunch” or “c'est bon خلاص”. It is common in the Maghreb (Arabic and French) and in the Gulf and Lebanon (Arabic and English). It affects every stage of processing: tokenization, word-level language identification, tagging and translation.

Try it: in the Dialects module, type “شكو ماكو اليوم؟ والله هواية زين” and then “إزيك عامل إيه”, and look at the evidence the lab shows for each dialect, then open the Iraqi Dialect Lab to browse the dictionary.

Lesson summary

  • MSA is the language of formal writing, and dialects are the language of daily speech that appears heavily on social media.
  • Dialect identification is hard because dialects share much vocabulary with MSA and with each other.
  • Models trained on MSA drop on dialects, and models trained on tweets (MARBERT) outperform them.

Check what you understood

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

  1. What is meant by diglossia?

  2. In Arabizi, what does the digit 7 usually represent?

References

  1. Ferguson, C. A. (1959). Diglossia. WORD 15(2) doi.org/10.1080/00437956.1959.11659702
  2. Bouamor, H. et al. (2018). The MADAR Arabic Dialect Corpus and Lexicon. LREC aclanthology.org/L18-1535/
  3. Abdul-Mageed, M. et al. (2020). NADI 2020: The First Nuanced Arabic Dialect Identification Shared Task. WANLP aclanthology.org/2020.wanlp-1.9/
  4. Darwish, K. (2014). Arabizi Detection and Conversion to Arabic. ANLP Workshop aclanthology.org/W14-3629/
  5. Abdul-Mageed, M., Elmadany, A. & Nagoudi, E. M. B. (2021). ARBERT & MARBERT: Deep Bidirectional Transformers for Arabic. ACL aclanthology.org/2021.acl-long.551/