Masakhane-Afrisenti at SemEval-2023 Task 12: Sentiment Analysis using Afro-centric Language Models and Adapters for Low-resource African Languages

Israel Abebe Azime, Sana Sabah Al-Azzawi, Atnafu Lambebo Tonja, Iyanuoluwa Shode, Jesujoba Alabi, Ayodele Awokoya, Mardiyyah Oduwole, Tosin Adewumi, Samuel Fanijo, Oyinkansola Awosan, Oreen Yousuf

TL;DR

This paper details the Masakhane team's approach to the AfriSenti-SemEval 2023 challenge, focusing on sentiment analysis for 14 low-resource African languages. By leveraging Afro-centric pre-trained language models and parameter-efficient adapters, the researchers demonstrate that models tailored to specific linguistic regions significantly outperform general-purpose multilingual models in both monolingual and zero-shot settings.

What Problem Does This Paper Address?

Natural Language Processing (NLP) has historically focused on a handful of high-resource languages, leaving many African languages "low-resource"—lacking the massive, high-quality datasets required to train modern AI models. Sentiment analysis, which identifies emotions and opinions in text, is particularly challenging in these contexts due to unique linguistic structures, cultural nuances, and the prevalence of code-switching on social media.

The authors participate in the AfriSenti-SemEval Shared Task 12, which aims to bridge this digital divide. They tackle three specific challenges:

  1. Sub-task A: Monolingual sentiment classification for 12 languages.
  2. Sub-task B: Multilingual sentiment classification across the dataset.
  3. Sub-task C: Zero-shot sentiment classification (predicting sentiment for languages not seen during training, specifically Tigrinya and Oromo).

Methods

The team moved beyond classical machine learning (like Naive Bayes or XGBoost) to explore a variety of Transformer-based architectures. Their strategy was tiered:

  • Afro-centric Models: They prioritized models pre-trained specifically on African data, such as AfroXLMR, AfriBERTa, and AfroLM.
  • Language-Specific Models: For certain dialects, they used specialized models like DziriBERT (for Algerian and Moroccan Arabic).
  • Adapters for Zero-Shot Transfer: For Task C, they employed a two-step adapter approach. First, they trained language-specific adapters using monolingual data to capture the target language's structure. Then, they trained task-specific adapters on sentiment data from a related language (e.g., using Amharic data to help predict Tigrinya sentiment) to enable transfer without direct training.
  • Ensembling: In the final testing phases, they used voting-based ensembles of their top-performing models to stabilize and improve predictions.

Datasets

The study utilizes the AfriSenti dataset, a collection of Twitter data covering 14 African languages. As shown in Figure 1, the dataset is significantly imbalanced, with languages like Hausa (hau) and Yoruba (yor) having much higher tweet counts than others like Swahili (swa) or Tsonga (tso).

Figure 1: Data distribution among the languages.

Key Insights and Ideas

  • Afro-centricity Matters: Pre-trained models that "see" African languages during their initial training phase consistently outperform massive, general-purpose multilingual models.
  • Linguistic Proximity is a Tool: For zero-shot tasks, the authors found success by leveraging similarities between languages. For example, training on Hausa data provided better results for Oromo than using unrelated high-resource languages, highlighting the importance of language family relationships in low-resource NLP.
  • Cleaning Isn't Always King: Surprisingly, removing '@user' tags, punctuation, and emojis did not significantly improve performance. The models were robust enough to handle the "noisy" nature of raw Twitter data.
  • Adapters are Efficient: The use of adapters proved to be a promising, parameter-efficient way to achieve zero-shot transfer, especially when resources for the target language are extremely limited.

Key Results

The team achieved competitive rankings across all tasks.

In Task A (Monolingual), the best model varied by language. For instance, LaBSE performed best for Amharic (68.85% F1), while AfriBerta-Large excelled for Igbo and Yoruba. Detailed comparisons are available in Table 1.

Table 1: Test phase comparison of F1-scores (%) for Task A sentiment analysis on 12 African languages using various pre-trained models. Models include (1) AfriBerta-large, (2) Dziribert, (3) LaBSE, (4) AfroXLMR-base, (5) AfroXLMR-small, (6) DarijaBERT, (7) AfroLM, (8) twitter-xlm-roberta-base-sentiment, (9) QARiB , and (10) Bernice.

In Task B (Multilingual), their ensemble of the top three models (AfroXLMR-base, LaBSE, and twitter-xlm-roberta) reached an F1-score of 70.34%, placing them 9th out of 33 teams.

Table 2: Test phase comparison of F1-scores (%) for Task B

For Task C (Zero-shot), the results for Tigrinya were particularly strong, with a multilingual AfroXLMR model reaching 61.48% F1.

Limitations and Future Work

The primary limitation noted was the data imbalance across languages, which makes it difficult for multilingual models to perform equitably. While the team attempted label-based and language-based balancing, these efforts did not yield significant gains.

Future work will likely focus on refining the adapter approach. The authors see great potential in using adapters to further improve zero-shot settings for related low-resource languages, potentially by incorporating more diverse monolingual corpora during the adapter training phase.

Summary updated

BibTeX
@inproceedings{azime2023masakhane,
  author = {Israel Abebe Azime and Sana Sabah Al-Azzawi and Atnafu Lambebo Tonja and Iyanuoluwa Shode and Jesujoba Alabi and Ayodele Awokoya and Mardiyyah Oduwole and Tosin Adewumi and Samuel Fanijo and Oyinkansola Awosan and Oreen Yousuf},
  title = {{Masakhane-Afrisenti at SemEval-2023 Task 12: Sentiment Analysis using Afro-centric Language Models and Adapters for Low-resource African Languages}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
}
Figure