| | --- |
| | license: mit |
| | language: |
| | - ny |
| | - en |
| | pretty_name: Chichewa Text-to-SQL |
| | size_categories: |
| | - n<1K |
| | task_categories: |
| | - table-question-answering |
| | tags: |
| | - text-to-sql |
| | - chichewa |
| | - low-resource-language |
| | - semantic-parsing |
| | - nlp |
| | - malawi |
| | - sql |
| | - qlora |
| | - few-shot |
| | --- |
| | |
| | # Chichewa Text-to-SQL |
| |
|
| | The **first structured Text-to-SQL benchmark for Chichewa**, a low-resource Bantu language spoken by over 12 million people in Malawi and neighboring regions. |
| | The dataset contains **400 manually curated natural language–SQL pairs** in both **Chichewa (Nyanja)** and **English**, grounded in a unified relational SQLite database covering five real-world domains from Malawi. |
| |
|
| | --- |
| |
|
| | ## Dataset Summary |
| |
|
| | This benchmark was constructed to investigate the adaptation of Large Language Models (LLMs) for Text-to-SQL generation in Chichewa. It supports systematic evaluation of zero-shot, few-shot (random and retrieval-augmented), and parameter-efficient fine-tuning (QLoRA) approaches for low-resource semantic parsing. |
| |
|
| | Key findings from the accompanying research: |
| | - **English** zero-shot execution accuracy: 20% → 50% (random few-shot) → 70% (RAG few-shot) → **76.7% (QLoRA)** |
| | - **Chichewa** zero-shot execution accuracy: 0% across all models → 41.7% (RAG few-shot) → **41.7% (QLoRA)** |
| |
|
| | --- |
| |
|
| | ## Database Schema |
| |
|
| | The SQLite database (`database/chichewa_text2sql.db`) contains five tables: |
| |
|
| | | Table | Description | |
| | |---|---| |
| | | `production` | Agricultural crop yield by district and season | |
| | | `population` | Census data with geographic and demographic breakdowns | |
| | | `mse_daily` | Malawi Stock Exchange daily trading data | |
| | | `commodity_prices` | Commodity price data across markets | |
| | | `food_insecurity` | Food insecurity indicators by region | |
| |
|
| | --- |
| |
|
| | ## Dataset Structure |
| |
|
| | ### Files |
| |
|
| | | File | Description | |
| | |---|---| |
| | | `data/all.json` | Full dataset (400 examples) | |
| | | `data/train.json` | Training split | |
| | | `data/dev.json` | Development/validation split | |
| | | `data/test.json` | Test split | |
| | | `data/human_translations.csv` | Human-verified translations | |
| | | `data/split_verification.json` | Split integrity verification | |
| | | `database/chichewa_text2sql.db` | SQLite database | |
| | | `database_tables_csv/` | Raw CSV files for each table | |
| |
|
| | ### Data Fields |
| |
|
| | Each example contains: |
| |
|
| | ```json |
| | { |
| | "id": 1, |
| | "question_en": "Which district produced the most Maize", |
| | "question_ny": "Ndi boma liti komwe anakolola chimanga chambiri?", |
| | "sql_statement": "SELECT district, MAX(yield) AS max_yield FROM production WHERE crop = 'Maize';", |
| | "sql_result": "[('Lilongwe', 444440.0)]", |
| | "difficulty_level": "easy", |
| | "table": "production" |
| | } |
| | ``` |
| |
|
| | ### Difficulty Levels |
| |
|
| | - `easy` — single table, simple SELECT / WHERE / ORDER BY |
| | - `medium` — aggregations, GROUP BY, LIMIT |
| | - `hard` — multi-condition queries, subqueries, JOINs |
| |
|
| | --- |
| |
|
| | ## Splits |
| |
|
| | | Split | Size | |
| | |---|---| |
| | | Train | ~280 | |
| | | Dev | ~60 | |
| | | Test | ~60 | |
| | | **Total** | **400** | |
| |
|
| | --- |
| |
|
| | ## Usage |
| |
|
| | ```python |
| | import json |
| | |
| | with open("data/train.json") as f: |
| | train = json.load(f) |
| | |
| | print(train[0]["question_ny"]) # Chichewa question |
| | print(train[0]["question_en"]) # English question |
| | print(train[0]["sql_statement"]) # Ground-truth SQL |
| | ``` |
| |
|
| | --- |
| |
|
| | ## Citation |
| |
|
| | If you use this dataset, please cite: |
| |
|
| | ```bibtex |
| | @dataset{eze2026chichewa, |
| | author = {Eze, John Emeka and Matekenya, Dunstan and Matthewe, Evance}, |
| | title = {Chichewa Text-to-SQL: A Low-Resource Benchmark for Semantic Parsing in Chichewa}, |
| | year = {2026}, |
| | publisher = {HuggingFace}, |
| | url = {https://huggingface.co/datasets/johneze/chichewa-text2sql} |
| | } |
| | ``` |
| |
|
| | --- |
| |
|
| | ## License |
| |
|
| | [MIT](https://opensource.org/licenses/MIT) |
| |
|