Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lyuqin/HydraNet-WikiSQL
Code and trained model for Hybrid ranking network for text-to-SQL on WikiSQL
https://github.com/lyuqin/HydraNet-WikiSQL
nl2sql text-to-sql wikisql
Last synced: 2 months ago
JSON representation
Code and trained model for Hybrid ranking network for text-to-SQL on WikiSQL
- Host: GitHub
- URL: https://github.com/lyuqin/HydraNet-WikiSQL
- Owner: lyuqin
- License: mit
- Created: 2020-07-29T19:08:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-20T21:10:52.000Z (about 1 year ago)
- Last Synced: 2024-08-18T11:13:39.371Z (6 months ago)
- Topics: nl2sql, text-to-sql, wikisql
- Language: Python
- Homepage: https://arxiv.org/abs/2008.04759
- Size: 17.6 KB
- Stars: 65
- Watchers: 2
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Text2SQL - [code
README
# Hybrid Ranking Network for Text-to-SQL
Code for our paper [Hybrid Ranking Network for Text-to-SQL](https://arxiv.org/abs/2008.04759)## Environment Setup
* `Python 3.8`
* `Pytorch 1.7.1` or higher
* `pip 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.
## Data Preprocessing
1. Create data folder and output folder first: `mkdir data && mkdir output`
2. Clone WikiSQL repo:
`git clone https://github.com/salesforce/WikiSQL && tar xvjf WikiSQL/data.tar.bz2 -C WikiSQL`
3. Preprocess data:
`python wikisql_gendata.py`
## Training
1. Run `python main.py train --conf conf/wikisql.conf --gpu 0,1,2,3 --note "some note"`.
2. Model will be saved to `output` folder, named by training start datetime.## Evaluation
1. Modify model, input and output settings in `wikisql_prediction.py` and run it.
2. Run WikiSQL evaluation script to get official numbers: `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
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.