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 found | Your choice | What to do |
|---|---|---|
| Your language is covered by MasakhaNER 2, and its labels (person, organisation, location, date) are enough for your task | Reuse MasakhaNER 2 | Do not build a new corpus for these labels. |
| Your language is covered, but you need extra entity types (money, products, culture-specific) | Extend it | Annotate 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 small | Try 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 20 | Build from scratch | Start 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:
- The MasakhaNER case study in this playbook: how the project was organised and what the team learned.
- The MasakhaNER 2 paper (Adelani et al., 2022): the 20-language dataset and its analysis.
- The MasakhaNER 1 paper (Adelani et al., 2021): how the annotation process was designed.
- The participatory research paper (Nekoto et al., 2020): the Masakhane way of working that MasakhaNER grew out of.
Questions to ask the authors:
- How did you recruit and coordinate annotators in 20 countries?
- Where did annotators disagree most, and how did you resolve it?
- 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.



