Skip to content

[EMNLP 2023 Findings] ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought

Notifications You must be signed in to change notification settings

X-LANCE/text2sql-GPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ACT-SQL

This is the project containing the source code for the EMNLP2023 paper ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought in EMNLP 2023 findings. If you find it useful, please cite our work.

@misc{zhang2023actsql,
      title={ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought}, 
      author={Hanchong Zhang and Ruisheng Cao and Lu Chen and Hongshen Xu and Kai Yu},
      year={2023},
      eprint={2310.17342},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Run ACT-SQL

  1. Create the data directory and move the downloaded datasets into this directory.
  2. Create the plm directory and move the downloaded pretrained sentence BERT models into this directory.
  3. As for the multi-turn text-to-SQL dataset, run multiturn.py firstly to convert the dataset into the single-turn text-to-SQL dataset. Here is an example.
python multiturn.py --dataset sparc
  1. Run cot.py to automatically generate the chain-of-thoughts for all examples in the train set. Here is an example.
python cot.py --dataset spider
  1. Run main.py to run ACT-SQL on the dev set. Here is an example.
python main.py --dataset spider --cot

About

[EMNLP 2023 Findings] ACT-SQL: In-Context Learning for Text-to-SQL with Automatically-Generated Chain-of-Thought

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages