Elamur Research⌕
☰
home / papers / 2022 / TF-IDF or Transformers for Arabic Dialect Identification? ITFLOWS participation in the NADI 2022 Shared Task

TF-IDF or Transformers for Arabic Dialect Identification? ITFLOWS participation in the NADI 2022 Shared Task

Paper · 2022 · Fouad Shammary, Yiyi Chen, Zsolt T Kardkovacs et al.

Summary

The paper describes the ITFLOWS team's entry to NADI 2022 Subtask 1, which asks systems to label tweets with the country-level Arabic dialect they come from. The labels come from geolocation, not linguistic annotation. The training set was small and imbalanced, and external labeled data was forbidden. The authors compared three systems:

  • a classical TF-IDF "fingerprint" classifier built on character n-grams, with an optional transliteration step;
  • MARBERT fine-tuned in full;
  • MARBERT trained through adapters on a training set where minority classes were augmented with contextual word insertion.

The adapter model was strongest on the development data and on TEST-B. However, it did worst on TEST-A, where the TF-IDF system had the best accuracy. Together the submissions placed second in the shared task on average. The authors conclude that much dialect signal probably sits below the word level, which MARBERT's tokenization hides. They suggest that subword- or transliteration-aware Arabic transformers are worth building. The work matters because a cheap, transparent baseline matched a large pretrained model on one test set.

Key points

  • Data: 20,398 training tweets and 4,872 validation tweets cover 18 country dialects. The unlabeled test sets are TEST-A (4,758 tweets) and TEST-B (1,473 tweets, with an undisclosed set of dialects). Evaluation uses macro-averaged F1.
  • TF-IDF system:
    • All tweets of one label are merged into a single "document," and 1–7-gram patterns serve as fingerprints.
    • A pattern must exceed a frequency threshold inside its dialect and be missing from at least k dialects.
    • (3, 9) patterns gave the best accuracy, and prediction is by maximum likelihood.
    • Transliteration helped, while balancing classes by random sampling hurt accuracy.
  • Augmentation:
    • Every class below 10% of the data received one or two words inserted via MARBERT contextual embeddings, following the EDA insertion idea.
    • Duplicates were then removed, so that, for example, "uae" grew from 642 to 1,284 tweets.
  • Training setups:
    • Full fine-tuning: MARBERT feeds max pooling and dense layers, trained for 5 epochs with early stopping on balanced accuracy.
    • Adapters: task adapters use PfeifferConfig, with the last-layer adapter dropped (MAD-X 2.0). Settings were lr 1e-4, batch 16 and 6 epochs, and the checkpoint at step 4500 was used.
  • Errors:
    • The model over-predicts large classes and confuses neighboring dialects; for example, UAE tweets were often tagged as Oman or KSA.
    • Qatar and Bahrain received zero correct DEV predictions.

Interesting ideas

  • I1. Visually identical words can hide different Unicode code points, such as Arabic presentation forms versus base letters, so normalizing or transliterating to one alphabet before n-gram counting removes false distinctions.
  • I2. Treating each class as one document gives readable fingerprints: patterns frequent in a class but absent from at least k other classes, scored by likelihood. This makes a fully inspectable classifier.
  • I3. Augmenting only under-represented classes, by inserting one or two context-predicted words and then deduplicating, enlarges rare classes without flooding common ones.
  • I4. The best model on dev was the worst on one test split, while the simple baseline stayed consistent across two differently sampled test sets. This shows the value of scoring on several splits and tracking stability.
  • I5. The confusion matrix showed errors drifting toward similar, larger classes, which separates prior bias from genuine confusability.

For Mova

How these ideas could serve Mova, our small open language model — its files, stages and tests:

  • I1 (tokens): Add a Unicode normalization pass (NFKC, ligatures, curly quotes, full-width forms) ahead of the en tokenizer, and log each mapping so the step stays explainable.
  • I2 (tree): Such fingerprints could detect which treebank style or English variety an input resembles, so the right UD dialect conversion is picked with a visible justification.
  • I3 (learn): Rare frames or construction types in silver data could be expanded this way, provided the witness parsers still agree on the modified sentences.
  • I4 (learn): Mova's evaluation could always report variance across held-out sets with different sampling, keeping a simple transparent baseline as a control.
  • I5 (frames): Speech-act or semantic-role confusion matrices could check whether errors collapse into frequent neighboring labels, guiding targeted repair rules.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Institutions

Also on the byline: FIZ Karlsruhe – Leibniz Institute for Information Infrastructure.

 Fields, topics and concepts

📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksArts and Humanities · 16,039 worksLanguage and Linguistics · 15,891 works

🧭 Topics 1Research subjects and languages the work is about.Semitic languages · 2,908 works

💡 Concepts 1Key ideas and methods explained on our concept pages.TF-IDF · 26 works

Cite

Cite as Fouad Shammary, Yiyi Chen, Zsolt T Kardkovacs, Mehwish Alam and Haithem Afli. 2022. TF-IDF or Transformers for Arabic Dialect Identification? ITFLOWS participation in the NADI 2022 Shared Task. Proceedings of the Seventh Arabic Natural Language Processing Workshop (WANLP).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2022.wanlp-1.42

@inproceedings{shammary2022tf,
  title = {{TF-IDF or Transformers for Arabic Dialect Identification? ITFLOWS participation in the NADI 2022 Shared Task}},
  author = {Fouad Shammary, Yiyi Chen, Zsolt T Kardkovacs, Mehwish Alam and Haithem Afli},
  booktitle = {Proceedings of the Seventh Arabic Natural Language Processing Workshop (WANLP)},
  year = {2022},
  doi = {10.18653/v1/2022.wanlp-1.42},
  url = {https://doi.org/10.18653/v1/2022.wanlp-1.42}
}

References

6 references, 5 of them with a card of ours. ↗ leads to the work.

  1. Muhammad Abdul-Mageed, AbdelRahim A. Elmadany, and El Moatez Billah Nagoudi. 2021. ARBERT & MARBERT: deep bidirectional transformers for arabic. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, ACL/IJCNLP 2021, (Volume 1: Long Papers), Virtual Event, August 1-6, 2021, pages 7088–7105. Association for Computational Linguistics. ↗
  2. Muhammad Abdul-Mageed, Chiyu Zhang, AbdelRahim Elmadany, Houda Bouamor, and Nizar Habash. 2022. NADI 2022: The Third Nuanced Arabic Dialect Identification Shared Task. In Proceedings of the Seven Arabic Natural Language Processing Workshop (WANLP 2022).
  3. Gael de Francony, Victor Guichard, Praveen Joshi, Haithem Afli, and Abdessalam Bouchekif. 2019. Hierarchical deep learning for Arabic dialect identification. In Proceedings of the Fourth Arabic Natural Language Processing Workshop, pages 249–253, Florence, Italy. Association for Computational Linguistics.
  4. Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. 2019. Parameter-efficient transfer learning for nlp. In International Conference on Machine Learning, pages 2790–2799. PMLR. ↗
  5. Jonas Pfeiffer, Andreas Rücklé, Clifton Poth, Aishwarya Kamath, Ivan Vulic, Sebastian Ruder, Kyunghyun Cho, and Iryna Gurevych. 2020a. Adapterhub: A framework for adapting transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, EMNLP 2020 - Demos, Online, November 16-20, 2020, pages 46–54. Association for Computational Linguistics.
  6. Jonas Pfeiffer, Ivan Vulić, Iryna Gurevych, and Sebastian Ruder. 2020b. MAD-X: An Adapter-Based Framework for Multi-Task Cross-Lingual Transfer. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 7654–7673, Online. Association for Computational Linguistics.

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/shammary-2022-tf-idf-or-transformers-arabic/