Instructions to use amidblue/AfrimBert-QA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amidblue/AfrimBert-QA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("question-answering", model="amidblue/AfrimBert-QA")# Load model directly from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("amidblue/AfrimBert-QA") model = AutoModelForQuestionAnswering.from_pretrained("amidblue/AfrimBert-QA") - Notebooks
- Google Colab
- Kaggle
AfrimBert-QA
Model Description
AfrimBert-QA is a fine-tuned version of amidblue/mBertKE trained on the amidblue/AfriQuAD dataset. It is designed for extractive question answering — both monolingual and cross-lingual — across African languages.
Supported Languages
The model supports 10+ African languages, with primary support for:
| Language | Region |
|---|---|
| Luo | Kenya/Uganda |
| Kalenjin | Kenya |
| Kikuyu | Kenya |
| Gusii | Kenya |
| Swahili | East Africa |
Training Data
The model was trained on a combination of the following datasets:
- KENSQUAD — Kenyan extractive QA dataset
- AFRIQA — Pan-African QA benchmark
- Custom data — Additional data collected for languages not covered by AFRIQA and KENSQUAD
Cross-lingual QA Dataset Stats
| Type | Approximate Size |
|---|---|
| Generated cross-lingual QA pairs | ~800 examples |
| Translated cross-lingual QA pairs | ~800 examples |
Usage
from transformers import pipeline
qa_pipeline = pipeline("question-answering", model="amidblue/AfrimBert-QA")
# Example context and question in Luo
context = "Ji mang'eny ok winjre gi kaka chama mar ODM iriembo. Tinde nitie koko mang'eny e chama no."
question = "Chama mane ema ji oko hero kaka iriembo?"
# Run the model
result = qa_pipeline(question=question, context=context)
print(f"Question: {question}")
print(f"Answer: {result['answer']}")
print(f"Confidence Score: {result['score']:.4f}")
print(f"Start: {result['start']}, End: {result['end']}")
Citation
If you use this model or its associated dataset, please cite:
@misc{afrimbert-qa,
author = {Theophilus Linicon Owiti and Alukwe Jones Terah},
title = {AfrimBert-QA: Extractive Question Answering for African Languages},
year = {2026},
publisher = {Hugging Face},
note = {Carnegie Mellon University, Amidblue},
url = {https://huggingface.co/amidblue/AfrimBert-QA}
}
Authors:
- Theophilus Linicon Owiti — Carnegie Mellon University / Amidblue
- Alukwe Jones Terah — Amidblue
Model Card Authors
Theophilus Linicon Owiti & Alukwe Jones Terah
- Downloads last month
- 31
Model tree for amidblue/AfrimBert-QA
Base model
amidblue/mBertKEDataset used to train amidblue/AfrimBert-QA
Viewer • Updated • 14.4k • 7