African language datasets: what exists and where the gaps are

For companies4 min read

A linguist and a software developer reviewing a printed table of language names at a university office in Addis Ababa, afternoon sun on the desk.

African language datasets now exist for named entities, sentiment, news topics and some reasoning tasks, but they cover far less than a product team usually needs. This post lists the main public resources, what each one covers, and the gaps you will have to fill with new expert data.

Who builds this data: the Masakhane community

Masakhane describes itself as a grassroots natural language processing community for Africa, run by Africans. The name roughly translates to we build together in isiZulu. Its stated aim is to strengthen NLP research for African languages with Africans leading and owning the work. Its projects page lists efforts such as MasakhaNER, MakerereNLP for text and speech in East Africa, NaijaNLP for sentiment and hate speech, LAFAND-MT and a question answering project.

Source: Masakhane(opens in a new tab)

The main public datasets

These are the main ones. Each is described in the authors' own abstract.

DatasetTaskCoverage
MasakhaNERNamed entity recognitionTen African languages
MasakhaNEWSNews topic classification16 languages widely spoken in Africa
AfriSentiTwitter sentiment14 languages, more than 110,000 tweets annotated by native speakers
NaijaSentiTwitter sentimentHausa, Igbo, Nigerian Pidgin and Yoruba
IrokoBenchInference, maths, knowledge QA17 low-resource African languages, human-translated

Source: MasakhaNER: Named Entity Recognition for African Languages (arXiv:2103.11811)(opens in a new tab)

Source: MasakhaNEWS: News Topic Classification for African languages (arXiv:2304.09972)(opens in a new tab)

Source: AfriSenti: A Twitter Sentiment Analysis Benchmark for African Languages (arXiv:2302.08956)(opens in a new tab)

Source: NaijaSenti: A Nigerian Twitter Sentiment Corpus for Multilingual Sentiment Analysis (arXiv:2201.08277)(opens in a new tab)

Source: IrokoBench: A New Benchmark for African Languages in the Age of Large Language Models (arXiv:2406.03368)(opens in a new tab)

MasakhaNER's authors call it the first sizable, openly available, high-quality NER dataset for its languages. NaijaSenti reports about 30,000 annotated tweets per language, and about 14,000 for Nigerian Pidgin, with a significant share of the tweets code-mixed. IrokoBench groups three tasks: natural language inference, mathematical reasoning and multiple-choice knowledge question answering.

What the numbers say about model quality

MasakhaNEWS gives a feel for how far prompting alone goes. The authors report that prompting ChatGPT without extra supervision averaged about 70 F1 points across their languages. A few-shot method with 10 examples per label reached 86.0 F1, which is about 93% of the 92.6 F1 from full supervised training. A small amount of good labelled data therefore buys a lot on a classification task.

IrokoBench points the other way for harder tasks. Its authors found performance much lower on African languages than on high-resource languages such as English and French, and that the best open model, Gemma 2 27B, reached 63% of GPT-4o's performance. Translating the test sets into English narrowed the gap for some large English-centric models, which tells you the weakness lies in the local language, not in the task.

Where African language datasets run out

Look at the task column above. Classification, entity recognition and sentiment are well represented. Of the resources listed, IrokoBench is the one that tests reasoning and knowledge. None of the datasets above is a collection of customer conversations, expert-written answers with rubrics, or ranked pairs of model replies, which is the kind of data that shapes how a chatbot behaves.

That is an observation about this list, not a survey of every project. Check the languages you care about before you assume a gap or an overlap, because coverage differs widely by language.

  • Instruction and conversation data in the local language, written by native speakers.
  • Preference rankings where raters pick the better of two replies in the language.
  • Domain content: health, law, finance and agriculture in the local language, checked by people who work in those fields.
  • Code-mixed text, since the NaijaSenti authors found much of their data mixed languages.
  • Fresh test sets that have not been published, to avoid contamination.

How to use public data and still fill the gaps

  1. List the languages and tasks your product needs, and match each against the public sets above.
  2. Use public data for baselines, so you know where models start.
  3. Hold out a private test set written by native speakers in your domain.
  4. Commission new data only where the public sets stop: conversations, rubrics, preference rankings.
  5. Check each dataset's licence before using it in a commercial product.

Licences differ between datasets and some restrict commercial use, so read the terms on each dataset page before you build on it. Check each set's licence terms before you use it.

Staffing the new data

Native speakers who are also trained in a field are scarce, so plan the recruitment early. A nurse who writes Hausa can check a health answer. A bilingual lawyer can check a contract summary. Pair them with language reviewers who can check spelling, register and tone.

Set the review rules before the first batch goes out. Decide how reviewers mark dialect variation, whether loanwords from English or French are acceptable, and how to treat names and places. Languages with several written forms need a stated convention, and your reviewers should be told what it is. A short pilot of 50 items will show where the guide is unclear, and it costs little compared with reworking thousands of rows later.

Curatrain vets linguists and domain experts with graded skill tests, and its approach is Africa first and open worldwide. Companies receive a shortlist of experts who passed the tests their project needs and approve each match themselves.