Datasets:
Luganda question and answer pairs
- Dataset: ai4ug/luganda_qa_pairs
- Author & Maintainer: Wesley Kambale (AI for Uganda Initiative)
- Project: Pearl Chat
- Organization: AI for Uganda Initiative
- Language: Luganda (
lug, ISO 639-3) - Script: Latin (
Latn) - Dataset version:
1.0.0 - License: Apache License 2.0 (
apache-2.0)
Overview
We developed and curated ai4ug/luganda_qa_pairs as a Luganda-language dataset to support research and development in question answering, conversational language modelling, and supervised fine-tuning (SFT). It contains 68,421 question and answer pairs comprising 8,898,295 words (including 3,860 multi-turn 5-message dialogues), covering a broad range of subjects across education, science, agriculture, healthcare, business, language, history, culture, and everyday life.
We built this dataset at the AI for Uganda Initiative as part of our work on Pearl Chat, a native Luganda conversational language model. Our goal is to provide clean, structured examples for training and evaluating language models in Luganda, a language that remains underrepresented in large-scale natural language processing research.
Each record includes a question, its corresponding answer, a combined text representation, and a single-turn or multi-turn conversational representation (system, user, and assistant). We also included fields for task classification, domain labels, language metadata, text statistics, quality scores, and dataset split assignments.
Dataset at a glance
| Property | Description |
|---|---|
| Total records | 68,421 |
| Total words | 8,898,295 |
| Multi-turn (5-message) dialogues | 3,860 |
| Language | Luganda |
| ISO 639-3 code | lug |
| Script | Latin (Latn) |
| Text normalization | Unicode NFC |
| Primary tasks | Question answering, conversational modelling, instruction tuning |
| Record structure | Question, answer, text, conversations, metadata |
| Splits | Train, validation, test |
| Split proportions | 80%, 10%, 10% |
| Primary project | Pearl Chat |
| Author & Maintainer | Wesley Kambale (AI for Uganda Initiative) |
| License | Apache 2.0 |
Intended uses
We designed this dataset to support the following applications:
- Supervised fine-tuning: Training language models to respond accurately to instructions and questions in Luganda.
- Conversational modelling: Adapting autoregressive language models to natural single-turn and multi-turn Luganda dialogue.
- Question answering: Training systems to generate grounded responses to Luganda-language questions.
- Language research: Studying Luganda vocabulary, syntax, text generation, and conversational behaviour.
- Evaluation: Measuring model performance on held-out Luganda question and answer pairs.
- African language technology: Advancing low-resource NLP and locally relevant language applications.
You can use this dataset independently or alongside other appropriately licensed Luganda corpora.
Dataset composition
Domain distribution
We categorised all records by subject domain across Ugandan society and daily life:
| Domain | Records | Share |
|---|---|---|
| Education and literacy | 12,447 | 18.2% |
| Science and technology | 10,932 | 16.0% |
| Agriculture | 10,420 | 15.2% |
| Health and medicine | 9,578 | 14.0% |
| Business and finance | 7,970 | 11.6% |
| Grammar and linguistics | 4,492 | 6.6% |
| History, culture and kingdoms | 3,048 | 4.5% |
| Geography and tourism | 2,967 | 4.3% |
| Civic life and law | 1,915 | 2.8% |
| Family, parenting and youth | 1,556 | 2.3% |
| Sports and entertainment | 1,148 | 1.7% |
| Urban life and transport | 869 | 1.3% |
| Encyclopedic knowledge | 431 | 0.6% |
| Science and education | 299 | 0.4% |
| Society and news | 183 | 0.3% |
| Culture and society | 161 | 0.2% |
| Society and occupations | 2 | <0.1% |
| Society and civics | 1 | <0.1% |
| Vocabulary and grammar | 1 | <0.1% |
| Society and finance | 1 | <0.1% |
| Total | 68,421 | 100% |
Task modes
Each record includes a mode field indicating its intended task:
| Mode | Records | Description |
|---|---|---|
dialog |
63,016 | Single-turn and multi-turn conversational question answering and response generation |
continuation |
4,928 | Text, literary, story, and sentence continuation |
translate |
477 | Meaning, proverb (engero), and lexical translation/explanation tasks |
| Total | 68,421 |
Dataset splits and deduplication
We partitioned the dataset into training, validation, and test subsets using an 80/10/10 allocation:
| Split | Records | Share | Words |
|---|---|---|---|
| Train | 54,731 | 80% | 7,122,060 |
| Validation | 6,839 | 10% | 891,350 |
| Test | 6,851 | 10% | 884,885 |
| Total | 68,421 | 100% | 8,898,295 |
Split construction
To prevent train-test contamination and memorization, we used Union-Find connected-component clustering to group related question and answer pairs before assigning records to splits.
We linked pairs whenever they shared either a canonicalised answer or a normalised question prefix, and assigned connected records to the same split so closely related examples do not appear across both training and evaluation sets.
Our verification checks confirm:
- Question overlap across the three splits:
0.0%. - Answer overlap across the three splits:
0.0%. - Exact cross-dataset overlap with ai4ug/luganda_prose:
0.0%.
For reproducible experiments, please preserve the supplied split assignments and avoid moving evaluation examples into training data.
Data format and schema
Each record contains the following principal fields:
| Field | Type | Description |
|---|---|---|
id |
String | Unique record identifier |
mode |
String | Task category (dialog, continuation, translate) |
domain |
String | Subject-domain classification |
split |
String | Dataset partition (train, validation, test) |
question |
String | Luganda-language question or prompt |
answer |
String | Corresponding response |
text |
String | Combined question and answer text |
added |
String | Record date in YYYY-MM-DD format |
language |
String | Language code, lug |
script |
String | Script code, Latn |
quality_score |
Number | Quality score (>= 0.80) |
char_length |
Integer | Character count |
word_count |
Integer | Word count |
conversations |
Array | Role-labelled conversational messages |
metadata |
Object | Structured record-level metadata |
Example record
{
"id": "lug_qa_000001",
"mode": "dialog",
"domain": "agriculture",
"split": "train",
"question": "Nga nnamaze okukungula muwogo gwange...",
"answer": "Kituufu nti ebitooto by'omuwogo...",
"text": "Ekibuuzo: Nga nnamaze okukungula muwogo gwange...\nOkuddamu: Kituufu nti ebitooto by'omuwogo...",
"added": "2026-10-15",
"language": "lug",
"script": "Latn",
"quality_score": 0.99,
"char_length": 482,
"word_count": 64,
"conversations": [
{
"role": "system",
"content": "Oli Pearl Chat, omuyambi wa AI ayogera Oluganda olutuufu era annyonnyola ebintu mu bujjuvu."
},
{
"role": "user",
"content": "Nga nnamaze okukungula muwogo gwange..."
},
{
"role": "assistant",
"content": "Kituufu nti ebitooto by'omuwogo..."
}
],
"metadata": {
"language": "lug",
"script": "Latn",
"quality_score": 0.99,
"domain": "agriculture",
"mode": "dialog",
"split": "train",
"char_length": 482,
"word_count": 64
}
}
Conversational representation
The conversations field provides a sequence of role-labelled messages:
system: Instructions defining the assistant's persona and task behaviour in Luganda.user: The question or instruction in Luganda.assistant: The corresponding response in Luganda.
You can use conversations directly in conversational fine-tuning pipelines or use the top-level question, answer, and text fields for standard question-answering and text-generation workflows.
Loading the dataset
Install the Hugging Face Datasets library:
pip install datasets
Load the dataset:
from datasets import load_dataset
dataset = load_dataset("ai4ug/luganda_qa_pairs")
print(dataset)
print(dataset["train"][0])
Access a particular split:
train_dataset = dataset["train"]
validation_dataset = dataset["validation"]
test_dataset = dataset["test"]
Access the question and answer fields:
example = train_dataset[0]
question = example["question"]
answer = example["answer"]
print("Question:", question)
print("Answer:", answer)
Access the conversational representation directly:
example = train_dataset[0]
for message in example["conversations"]:
print(message["role"], message["content"])
Data quality and limitations
We applied Unicode NFC normalization, HTML/boilerplate removal, PII scrubbing, Luganda language identification (LID) quality scoring, exact deduplication, and split-level overlap checks across every record in this dataset.
When training or deploying models on this dataset, please keep the following considerations in mind:
- Factual accuracy: For consequential domains such as healthcare, law, finance, and agricultural extension, model outputs should be reviewed and validated by qualified professionals.
- Linguistic variation: Luganda usage varies across speakers, regions, contexts, and registers.
- Domain balance: Education, science and technology, agriculture, healthcare, and business represent the largest share of records.
Citation and attribution
If you use this dataset in research, publications, model development, or other derived work, please cite it as follows:
Recommended citation
Kambale, W. (2026). Luganda Question and Answer Pairs (Version 1.0.0) [Dataset]. AI for Uganda Initiative. Hugging Face. https://huggingface.co/datasets/ai4ug/luganda_qa_pairs
BibTeX:
@misc{kambale2026lugandaqa,
author = {Kambale, Wesley},
title = {{Luganda Question and Answer Pairs}},
year = {2026},
publisher = {AI for Uganda Initiative},
howpublished = {\url{https://huggingface.co/datasets/ai4ug/luganda_qa_pairs}},
note = {Version 1.0.0. Dataset for Luganda-language question answering and conversational modelling, developed for the AI for Uganda Initiative}
}
Acknowledgements
We developed and curated this dataset at the AI for Uganda Initiative to advance African language technology and power Pearl Chat, a native Luganda conversational language model.
- Author: Wesley Kambale
- Initiative: AI for Uganda Initiative (
https://aiforuganda.org) - Dataset:
https://huggingface.co/datasets/ai4ug/luganda_qa_pairs - Project: Pearl Chat (
https://pearl.aiforuganda.org)
- Downloads last month
- 28