Code and trained model for Hybrid ranking network for text-to-SQL on WikiSQL
Code for our paper Hybrid Ranking Network for Text-to-SQL
Python 3.8
Pytorch 1.7.1
or higherpip install -r requirements.txt
We can also run experiments with docker image:
docker build -t hydranet -f Dockerfile .
The built image above contains processed data and is ready for training and evaluation.
mkdir data && mkdir output
git clone https://github.com/salesforce/WikiSQL && tar xvjf WikiSQL/data.tar.bz2 -C WikiSQL
python wikisql_gendata.py
python main.py train --conf conf/wikisql.conf --gpu 0,1,2,3 --note "some note"
.output
folder, named by training start datetime.wikisql_prediction.py
and run it.cd WikiSQL && python evaluate.py data/test.jsonl data/test.db ../output/test_out.jsonl
Note: the WikiSQL evaluation script will encounter error when running in Windows system. Hence we included the fixed version for Windows User (run in root folder): python wikisql_evaluate.py WikiSQL/data/test.jsonl WikiSQL/data/test.db output/test_out.jsonl
Trained model that can reproduce reported number on WikiSQL leaderboard is attached in the releases (see under "Releases" in the right column). Model prediction outputs are also attached.