Elamur Research⌕
☰
home / papers / 2022 / Building an Ensemble of Transformer Models for Arabic Dialect Classification and Sentiment Analysis

Building an Ensemble of Transformer Models for Arabic Dialect Classification and Sentiment Analysis

Paper · 2022 · Abdullah Khered, Ingy Abdelhalim Abdelhalim and Riza Batista-Navarro

Summary

The paper reports the UniManc team's systems for the NADI 2022 shared task. The task had two parts: identifying which of 18 Arab countries a dialectal tweet comes from, and classifying the sentiment of dialectal tweets. Both systems start from MARBERT, a BERT-style model pre-trained on MSA and dialectal tweets.

  • Dialect identification: the classes are heavily skewed, with Egypt dominating. The authors therefore built class-balanced copies of the training data by random undersampling, plus duplication-based oversampling for the larger caps. They then fine-tuned models on both the original and the balanced data.
  • Sentiment: they first continued MLM pre-training of MARBERT on 10 million unlabelled tweets supplied by the organisers, and only then fine-tuned.

For each subtask they varied seeds and learning rates, kept the strongest variants, and tried every subset of them as a probability-averaging ensemble, judging each subset on the dev set. Both systems placed second overall. Error analysis showed that very short tweets and neighbouring dialects cause most mistakes. From this the authors argue that dialect identification would be better framed as multi-label classification.

Key points

  • Subtask 1 balancing: each class was capped at 215 examples, matching the smallest classes (Bahrain, Qatar, Sudan). Extra variants were capped at 250 and 300, with rare classes oversampled by duplication.
  • Subtask 2 domain adaptation: MLM continuation used a 90/10 train/validation split of the unlabelled tweets, 8 epochs, batch size 8 and maximum length 512. It helped sentiment but not dialect ID.
  • Fine-tuning grid: seeds from 20 to 300 were explored, and 200 worked best for both subtasks. Learning rates between 1.5e-5 and 2.5e-5 were used, with batch size 32 and 8 epochs.
  • Ensembles:
    • Subtask 1 combined 8 candidates (4 trained on full data, 4 on balanced data), giving 255 possible subsets.
    • Subtask 2 combined 5 candidates, giving 31 subsets.
    • The top 3 ensembles by dev score were submitted.
  • Results:
    • Subtask 1 reached macro-F1 34.778 on Test-A (3rd) and 18.948 on Test-B (1st of 19 teams), for a mean of 26.863 (2nd).
    • Subtask 2 reached macro-F1-PN 73.544 (2nd of 10 teams).
    • Dev tweets of four tokens or fewer (864 samples) scored only 25.180 macro-F1, against 37.385 for longer ones.

Interesting ideas

  • I1. Ensembling models trained on the natural label distribution with models trained on rebalanced data combines their strengths: the first handles frequent classes well, the second can actually predict rare ones.
  • I2. Treating ensemble design as an exhaustive search over all non-empty subsets of a small pool of candidates, scored on held-out data, is cheap when the pool is small and avoids guessing which members help.
  • I3. Bucketing evaluation by input length showed that the overall score hid a sharp drop on very short inputs, where context is too thin to decide.
  • I4. Continued MLM pre-training on unlabelled in-domain text paid off for one downstream task but not the other, so domain adaptation should be checked per task rather than assumed.
  • I5. When classes genuinely overlap and even humans disagree, forcing a single label creates errors that are not really errors; allowing several labels per item matches the data better.

For Mova

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

  • I1 (tree): gparse could average dependency-label probabilities from a model trained on the plain treebank and one trained on data rebalanced toward rare relations. This could recover rare deprels without hurting frequent ones.
  • I2 (learn): the same subset search could pick which witness parsers should vote when building silver data. Negative controls should check that the chosen subset is not simply overfitting the dev set.
  • I3 (learn): parser and reader evaluations could report results per sentence-length bucket. This would show whether failures concentrate on fragments and headlines rather than on full sentences.
  • I4 (tree): before adopting an encoder further pre-trained on fables or school texts, its parsing LAS should be compared against the base encoder. This should be done separately for each downstream consumer.
  • I5 (frames): speech-act, irony or implicature judgments could carry multiple scored labels rather than a single forced choice. Downstream world-building could then keep the ambiguity visible instead of committing to one reading too early.

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

 Fields, topics and concepts

Cite

Cite as Abdullah Khered, Ingy Abdelhalim Abdelhalim and Riza Batista-Navarro. 2022. Building an Ensemble of Transformer Models for Arabic Dialect Classification and Sentiment Analysis. 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.53

@inproceedings{khered2022building,
  title = {{Building an Ensemble of Transformer Models for Arabic Dialect Classification and Sentiment Analysis}},
  author = {Abdullah Khered, Ingy Abdelhalim Abdelhalim and Riza Batista-Navarro},
  booktitle = {Proceedings of the Seventh Arabic Natural Language Processing Workshop (WANLP)},
  year = {2022},
  doi = {10.18653/v1/2022.wanlp-1.53},
  url = {https://doi.org/10.18653/v1/2022.wanlp-1.53}
}

References

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

  1. Muhammad Abdul-Mageed, AbdelRahim Elmadany, and El Moatez Billah Nagoudi. 2021a. 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 (Volume 1: Long Papers), pages 7088–7105, Online. Association for Computational Linguistics. ↗
  2. Muhammad Abdul-Mageed, Chiyu Zhang, Houda Bouamor, and Nizar Habash. 2020. NADI 2020: The first nuanced Arabic dialect identification shared task. In Proceedings of the Fifth Arabic Natural Language Processing Workshop, pages 97–110, Barcelona, Spain (Online). Association for Computational Linguistics. ↗
  3. Muhammad Abdul-Mageed, Chiyu Zhang, AbdelRahim Elmadany, Houda Bouamor, and Nizar Habash. 2021b. NADI 2021: The second nuanced Arabic dialect identification shared task. In Proceedings of the Sixth Arabic Natural Language Processing Workshop, pages 244–259, Kyiv, Ukraine (Virtual). Association for Computational Linguistics. ↗
  4. 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).
  5. Nada Boudjellal, Huaping Zhang, Asif Khan, Arshad Ahmad, Rashid Naseem, Jianyun Shang, and Lin Dai. 2021. ABioNER: a BERT-based model for Arabic biomedical named-entity recognition. Complexity, 2021:1–6. ↗
  6. Nitesh V. Chawla. 2010. Data Mining for Imbalanced Datasets: An Overview, pages 875–886. Springer US, Boston, MA. find
  7. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota. Association for Computational Linguistics. ↗
  8. Qi Liu, Matt J Kusner, and Phil Blunsom. 2020. A survey on contextual embeddings. arXiv preprint arXiv:2003.07278. ↗
  9. El Moatez Billah Nagoudi, AbdelRahim Elmadany, and Muhammad Abdul-Mageed. 2022. AraT5: Text-to-text transformers for Arabic language generation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 628–647, Dublin, Ireland. Association for Computational Linguistics.
  10. Oumaima Oueslati, Erik Cambria, Moez Ben HajHmida, and Habib Ounelli. 2020. A review of sentiment analysis research in arabic language. Future Generation Computer Systems, 112:408–430.
  11. L. Rokach. 2019. Ensemble Learning: Pattern Classification Using Ensemble Methods. Series in machine perception and artificial intelligence. World Scientific Publishing. ↗
  12. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. Advances in Neural Information Processing Systems, 30.

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/khered-2022-building-ensemble-transformer-models-arabic/