Download README.md from Mytho0610/light-sql-gretel: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/Mytho0610/light-sql-gretel/resolve/main/README.md
- Command line
-
hf download hf://Mytho0610/light-sql-gretel/README.md
-
curl -L -o README.md https://huggingface.co/Mytho0610/light-sql-gretel/resolve/main/README.md
license: apache-2.0
tags:
- text-to-sql
- in-context-learning
- retrieval
- small-language-model
base_model: microsoft/Phi-3-mini-4k-instruct
datasets:
- gretelai/synthetic_text_to_sql
Light-SQL (Gretel): SLM + in-context learning with semantic retrieval
Triển khai theo Light-SQL: A Small Language Model Based Approach Using In-Context Learning for Natural Language to SQL
(Kieu-Trang Nguyen, Quang-Hung Le, ICCIES 2026). Không fine-tune: repo này chứa kho 49,969 ví dụ (câu hỏi, SQL, schema rút gọn)
từ gretelai/synthetic_text_to_sql và các vector embedding (BAAI/bge-small-en, chuẩn hóa, float16) cho 3 chiến lược chọn ví dụ (QTSS / MQSS / QRSS).
SLM nền: microsoft/Phi-3-mini-4k-instruct (tải từ Hugging Face, không đổi).
Cách dùng: nạp example_bank.jsonl + emb_question.npy, embedding câu hỏi mới bằng BAAI/bge-small-en, lấy 3 ví dụ có tích vô hướng lớn nhất,
dựng prompt ### Instruction / ### Schema / ### Few-shot Examples / ### Question / ### Response, rồi để SLM sinh SQL (temperature 0).
Mã đầy đủ nằm trong notebook đi kèm.