replysadiq/qatar-customs-nl2sql
Qatar Customs NL2SQL โ Arabic Natural Language to SAP HANA SQL Fine-tuning dataset for converting Arabic natural language questions into SAP HANA SQL queries for the Qatar General Directorate of Customs (GDC) database. Dataset Overview Metric Value Total question sets 99 Training examples 320 (3 fuzz levels ร 80 questions + 80 follow-ups) Test examples 76 (3 fuzz levels ร 19 questions + 19 follow-ups) Language Arabic ๐ถ๐ฆ (formal + dialectal)โฆ See the full description on the dataset page: https://huggingface.co/datasets/replysadiq/qatar-customs-nl2sql.
Qatar Customs NL2SQL โ Arabic Natural Language to SAP HANA SQL
Fine-tuning dataset for converting Arabic natural language questions into SAP HANA SQL queries for the Qatar General Directorate of Customs (GDC) database.
Dataset Overview
3 Fuzz Levels
Each question has 3 difficulty variants to train robustness:
Database Schema (7 Main Tables + 31 Lookup Tables)
Full DDL in eval/schema.sql.
Training
pip install transformers trl torch datasets trackio accelerate peft bitsandbytes
python scripts/train.pyHardware: Single GPU with 24GB VRAM (A10G, A100, RTX 4090) โ QLoRA 4-bit Time: ~2-3 hours Output: LoRA adapter pushed to replysadiq/qatar-customs-nl2sql-qwen7b
Evaluation
python scripts/evaluate.py <model_path>Metrics: exact match, table accuracy, column accuracy, structural similarity, HANA function accuracy, fuzz degradation.
Files
โโโ train.jsonl # 320 training examples
โโโ test.jsonl # 76 test examples (held out)
โโโ eval/
โ โโโ test_with_meta.jsonl # Test data with metadata (question_num, fuzz_level)
โ โโโ schema.sql # Full HANA DDL for all tables
โโโ scripts/
โโโ train.py # QLoRA training script
โโโ evaluate.py # Evaluation framework
โโโ build_dataset.py # Dataset construction from Excel