MasakhaNEWS: News Topic Classification for African languages

David Ifeoluwa Adelani, Marek Masiak, Israel Abebe Azime, Jesujoba Alabi, Atnafu Lambebo Tonja, Christine Mwase, Odunayo Ogundepo, Bonaventure F. P. Dossou, Akintunde Oladipo, Doreen Nixdorf, Chris Chinenye Emezue, sana al-azzawi, Blessing Sibanda, Davis David, Lolwethu Ndolela, Jonathan Mukiibi, Tunde Ajayi, Tatiana Moteu, Brian Odhiambo, Abraham Owodunni, Nnaemeka Obiefuna, Muhidin Mohamed, Shamsuddeen Hassan Muhammad, Teshome Mulugeta Ababu, Saheed Abdullahi Salahudeen, Mesay Gemeda Yigezu, Tajuddeen Gwadabe, Idris Abdulmumin, Mahlet Taye, Oluwabusayo Awoyomi, Iyanuoluwa Shode, Tolulope Adelani, Habiba Abdulganiyu, Abdul-Hakeem Omotayo, Adetola Adeeko, Abeeb Afolabi, Anuoluwapo Aremu, Olanrewaju Samuel, Clemencia Siro, Wangari Kimotho, Onyekachi Ogbu, Chinedu Mbonu, Chiamaka Chukwuneke, Samuel Fanijo, Jessica Ojo, Oyinkansola Awosan, Tadesse Kebede, Toadoum Sari Sakayo, Pamela Nyatsine, Freedmore Sidume, Oreen Yousuf, Mardiyyah Oduwole, Tshinu Tshinu, Ussen Kimanuka, Thina Diko, Siyanda Nxakama, Sinodos Nigusse, Abdulmejid Johar, Shafie Mohamed, Fuad Mire Hassan, Moges Ahmed Mehamed, Evrard Ngabire, Jules Jules, Ivan Ssenkungu, Pontus Stenetorp

TL;DR

The authors introduce MasakhaNEWS, the largest human-annotated news topic classification dataset for 16 typologically diverse African languages. Their evaluation shows that while African-centric supervised models perform best, few-shot techniques like Pattern Exploiting Training (PET) can reach over 90% of supervised performance with as few as 10 labeled examples per category.

What Problem Does This Paper Address?

Despite representing nearly 20% of the world's population, African languages are severely underrepresented in Natural Language Processing (NLP) research. The primary hurdle is a "data desert"—a lack of high-quality, human-annotated datasets for training and benchmarking models.

While progress has been made in tasks like Named Entity Recognition (NER) and Machine Translation (MT), news topic classification—a fundamental task for evaluating how well a language model understands a language—has lacked a standardized, geographically diverse, and consistently labeled benchmark for the African continent. Existing datasets are often small, lack human verification, or use inconsistent categories, making it difficult to compare models across different languages.

Methods

The researchers conducted a comprehensive evaluation using three main paradigms:

  1. Supervised Learning: They trained classical machine learning models (XGBoost, MLP, Naive Bayes) and fine-tuned a variety of multilingual Large Language Models (LLMs). These included massively multilingual encoders (like XLM-R and RemBERT) and specialized African-centric models (like AfroXLMR and AfriBERTa).
  2. Zero-Shot Transfer: They tested how models perform on a target language without any training data in that language. Techniques included MAD-X (using parameter-efficient adapters to transfer knowledge from a source language like Swahili) and direct prompting of LLMs like GPT-3.5-Turbo and GPT-4.
  3. Few-Shot Learning: They explored adaptation with extremely limited data (5 to 50 examples per label). Key methods included Pattern Exploiting Training (PET), which reformulates classification as a cloze-style completion task, and SetFit, which uses contrastive learning to fine-tune sentence transformers.

Datasets

The core contribution is the MasakhaNEWS dataset.

  • Coverage: 16 languages, including Amharic, English, French, Hausa, Igbo, Lingala, Luganda, Naija (Nigerian Pidgin), Oromo, Rundi, chiShona, Somali, Kiswahili, Tigrinya, isiXhosa, and Yorùbá.
  • Source: Articles were crawled from reputable outlets like the BBC and VOA.
  • Annotation: Native speakers from the Masakhane community labeled the data into eight consistent categories: business, entertainment, health, politics, religion, sports, technology, and uncategorized.
Table 1: Languages covered and Data Source

Key Insights and Ideas

  • Context is King: Models perform significantly better when given the headline plus the first two sentences of an article (Headline+Text) compared to just the headline. This was especially true for classical ML models, which saw F1-score jumps of nearly 10 points.
Figure 1: Comparison of article content type used for training news topic classification models. We report the average across all languages when either headline or headline+text is used
  • African-Centricity Matters: Models pre-trained specifically on African languages (like AfroXLMR) consistently outperformed much larger, massively multilingual models. This highlights the importance of including diverse, representative data during the pre-training phase.
  • The GPT-4 Script Leap: GPT-3.5 struggled significantly with non-Latin scripts (like the Ge'ez script used for Amharic and Tigrinya). However, GPT-4 showed a massive improvement, matching the performance of specialized cross-lingual transfer methods for these languages.
  • Efficiency of Few-Shot Learning: The most encouraging finding for low-resource settings is the effectiveness of PET. Using a relatively small model (AfroXLMR-large), PET achieved competitive results with very little data, suggesting a viable path for developing NLP tools for languages where large-scale annotation is impossible.

Key Results

  • Supervised Baseline: The AfroXLMR-large model achieved the highest overall performance, with an average F1-score of 92.6 across all 16 languages.
  • Zero-Shot: GPT-4 reached an average F1 of 82.5, while the best adapter-based method (MAD-X transferring from Swahili) achieved 84.0.
  • Few-Shot: With just 10 examples per label, the PET approach reached an F1-score of 86.0, which is over 90% of the performance achieved by training on the full supervised dataset.
Table 3: Supervised Baseline results across different models and languages.

Limitations and Future Work

The authors note several limitations:

  • Task Scope: The evaluation of LLMs like ChatGPT was limited to classification; performance might differ on more complex generative tasks like question answering.
  • Reproducibility: Using closed-source APIs (like OpenAI's) makes reproducibility difficult as the underlying models are frequently updated.
  • Language Coverage: While 16 languages is a major step forward, it represents only a fraction of the 2,000+ languages spoken in Africa.

Future work involves expanding MasakhaNEWS to more languages and extending this benchmarking approach to other text classification tasks like sentiment analysis.

Summary updated

Abstract

African languages are severely under-represented in NLP research due to lack of datasets covering several NLP tasks. While there are individual language specific datasets that are being expanded to different tasks, only a handful of NLP tasks (e.g. named entity recognition and machine translation) have standardized benchmark datasets covering several geographical and typologically-diverse African languages. In this paper, we develop MasakhaNEWS -- a new benchmark dataset for news topic classification covering 16 languages widely spoken in Africa. We provide an evaluation of baseline models by training classical machine learning models and fine-tuning several language models. Furthermore, we explore several alternatives to full fine-tuning of language models that are better suited for zero-shot and few-shot learning such as cross-lingual parameter-efficient fine-tuning (like MAD-X), pattern exploiting training (PET), prompting language models (like ChatGPT), and prompt-free sentence transformer fine-tuning (SetFit and Cohere Embedding API). Our evaluation in zero-shot setting shows the potential of prompting ChatGPT for news topic classification in low-resource African languages, achieving an average performance of 70 F1 points without leveraging additional supervision like MAD-X. In few-shot setting, we show that with as little as 10 examples per label, we achieved more than 90\% (i.e. 86.0 F1 points) of the performance of full supervised training (92.6 F1 points) leveraging the PET approach.
BibTeX
@misc{adelani2023masakhanews,
  author = {David Ifeoluwa Adelani and Marek Masiak and Israel Abebe Azime and Jesujoba Alabi and Atnafu Lambebo Tonja and Christine Mwase and Odunayo Ogundepo and Bonaventure F. P. Dossou and Akintunde Oladipo and Doreen Nixdorf and Chris Chinenye Emezue and sana al-azzawi and Blessing Sibanda and Davis David and Lolwethu Ndolela and Jonathan Mukiibi and Tunde Ajayi and Tatiana Moteu and Brian Odhiambo and Abraham Owodunni and Nnaemeka Obiefuna and Muhidin Mohamed and Shamsuddeen Hassan Muhammad and Teshome Mulugeta Ababu and Saheed Abdullahi Salahudeen and Mesay Gemeda Yigezu and Tajuddeen Gwadabe and Idris Abdulmumin and Mahlet Taye and Oluwabusayo Awoyomi and Iyanuoluwa Shode and Tolulope Adelani and Habiba Abdulganiyu and Abdul-Hakeem Omotayo and Adetola Adeeko and Abeeb Afolabi and Anuoluwapo Aremu and Olanrewaju Samuel and Clemencia Siro and Wangari Kimotho and Onyekachi Ogbu and Chinedu Mbonu and Chiamaka Chukwuneke and Samuel Fanijo and Jessica Ojo and Oyinkansola Awosan and Tadesse Kebede and Toadoum Sari Sakayo and Pamela Nyatsine and Freedmore Sidume and Oreen Yousuf and Mardiyyah Oduwole and Tshinu Tshinu and Ussen Kimanuka and Thina Diko and Siyanda Nxakama and Sinodos Nigusse and Abdulmejid Johar and Shafie Mohamed and Fuad Mire Hassan and Moges Ahmed Mehamed and Evrard Ngabire and Jules Jules and Ivan Ssenkungu and Pontus Stenetorp},
  title = {{MasakhaNEWS: News Topic Classification for African languages}},
  year = {2023},
  eprint = {2304.09972},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.09972},
}
Figure