https://github.com/mohammadrezapourreza/few-shot-nl2sql-with-prompting
https://github.com/mohammadrezapourreza/few-shot-nl2sql-with-prompting
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mohammadrezapourreza/few-shot-nl2sql-with-prompting
- Owner: MohammadrezaPourreza
- License: mit
- Created: 2023-03-16T16:33:24.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-30T13:41:47.000Z (over 1 year ago)
- Last Synced: 2024-08-18T11:13:38.365Z (about 1 year ago)
- Language: Python
- Size: 161 KB
- Stars: 297
- Watchers: 5
- Forks: 58
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- Awesome-Text2SQL - [code
README
# Few-shot-NL2SQL-with-prompting
## Table of contents
* [Dataset](#dataset)
* [Setup](#setup)
* [Citation](#citation)
## dataset
To reproduce the results reported in the paper, please download the Spider dataset from the link below and create a data directory containing the tables.json and dev.json files.
```
$ Spider dataset = "https://drive.google.com/uc?export=download&id=1TqleXec_OykOYFREKKtschzY29dUcVAQ"
```
## setup
To run this project, use the following commands:
```
$ pip3 install -r requirements.txt
$ echo "Start running DIN-SQL.py"
$ python3 DIN-SQL.py --dataset ./data/ --output predicted_sql.txt
$ echo "Finished running DIN-SQL.py"
```
## citation
```
@article{pourreza2023din,
title={DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-Correction},
author={Pourreza, Mohammadreza and Rafiei, Davood},
journal={arXiv preprint arXiv:2304.11015},
year={2023}
}
```