ወደ ዋናው ይዘት ዝለል

Named Entity Recognition

Worked example. Last reviewed: 2026-07-07.

This page applies the four steps from Before You Start to named entity recognition (NER): finding people, organisations, places, and dates in text. It uses MasakhaNER as the example because it is the best-documented NER effort for African languages. If your language is not mentioned here, go back to Step 1 and search.

Step 1: What a search turns up​

Search Hugging Face, Lanfrica, or the ACL Anthology for NER in almost any major African language and you will quickly reach two datasets:

  • MasakhaNER 2 (Adelani et al., 2022): 20 languages. Bambara, Chichewa, chiShona, Ewe, Fon, Ghomala, Hausa, Igbo, isiXhosa, isiZulu, Kinyarwanda, Kiswahili, Luganda, Luo, Mossi, Nigerian Pidgin, Setswana, Twi, Wolof, and Yoruba.
  • MasakhaNER 1 (Adelani et al., 2021): the first 10 languages. Version 2 covers most of them, but version 1 is still the one to use for Amharic, which version 2 does not include. Its paper also explains how the annotation process was designed.

The data is on the Hugging Face Hub, and the GitHub repository has the annotation guidelines and evaluation scripts.

You will also find automatically labelled ("silver") NER data that covers many more languages, built by projecting labels from Wikipedia links rather than by human annotators. It is tempting because of its coverage. Step 2 is where you find out whether its quality is good enough for your purpose.

Step 2: Judging MasakhaNER 2 against the checklist​

  • Licence. CC BY-NC 4.0: free for research, not for commercial use. If you are building a product, check this first.
  • Access. Openly downloadable from Hugging Face and GitHub.
  • Fit. News text. Social media, government documents, or speech transcripts look different, so expect lower accuracy on them.
  • Script. Latin script only. Hausa Ajami, Arabic-script Wolof, and Ge'ez-script languages are not covered.
  • Code-switching. The sentences are monolingual. Real text often mixes languages within a sentence (Hausa–English, Swahili–English, French–Wolof). If yours does, expect results to be worse than the published numbers.
  • Labels. Person, organisation, location, and date. "Organisation" may not match what your use case means by it, so read the guidelines before assuming the label set fits.
  • Splits. Fixed train, development, and test splits, so results are comparable across papers.
  • Guidelines. Released. Even if your language is not covered, the guidelines are the best starting point for writing your own.
  • Quality. Annotated by native speakers through a participatory process. The papers describe it in detail.
  • Diacritics. In Yoruba, Igbo, and several other languages, tone marks carry meaning. Check that your text processing keeps them, or entity boundaries will shift and results will look worse than they are.

Step 3: Reuse, extend, or build​

Find the row that matches your situation, then follow it across. The first question is whether your language is covered by MasakhaNER 2.

What you foundYour choiceWhat to do
Your language is covered by MasakhaNER 2, and its labels (person, organisation, location, date) are enough for your taskReuse MasakhaNER 2Do not build a new corpus for these labels.
Your language is covered, but you need extra entity types (money, products, culture-specific)Extend itAnnotate the extra types on the existing splits and reuse the guidelines. Do not re-annotate person, organisation, and location; merge.
Your language is not covered, but it is related to one of the 20 (same family or script)Borrow, then build smallTry cross-language transfer from the closest covered language, then build a small evaluation set in your own language using the MasakhaNER guidelines.
Your language is not covered and not related to any of the 20Build from scratchStart with the long-tail language onboarding chapter, then Data Collection, Annotation Design, and Data Quality. Read the MasakhaNER guidelines before writing your own, and aim for 5,000–10,000 sentences to start.

Step 4: Learning from the people who built it​

MasakhaNER was built by volunteer researchers and native-speaker annotators across Africa. Their way of organising the work is worth studying before you design your own project.

Read first:

Questions to ask the authors:

  1. How did you recruit and coordinate annotators in 20 countries?
  2. Where did annotators disagree most, and how did you resolve it?
  3. What changed between version 1 and version 2, and why?

Once you have your data, training a model is well covered elsewhere. The Hugging Face token classification tutorial is a good start.

Contributors
@abumafrim@shmuhammadd

Join the discussion

Spotted an error, have a question, or want to share what worked on a real project? Sign in with GitHub to add your voice. Every thread lives in the open, powered by GitHub Discussions.

Loading discussion…
Masakhane African Languages Hub logo

Supported by

Masakhane African Languages Hub

The AfriPlaybook is supported by the Masakhane African Languages Hub, a pan-African initiative building open, culturally grounded datasets for African languages. We are grateful for its support.

About the Hub

In collaboration with

  • Bayero University, Kano
  • Bahir Dar University
  • HausaNLP
  • EthioNLP