Skip to content
/ MST-SQL Public
forked from ygxw0909/MST-SQL

text-to-SQL with Semi-Supervised Learning and Meta-learning

Notifications You must be signed in to change notification settings

KSESEU/MST-SQL

 
 

Repository files navigation

MST-SQL

Data and Code for paper Improving Few-Shot Text-to-SQL with Meta Self-Training via Column Specificity is available for research purposes.

Requirement

  • python 3.7.11
  • pytorch 1.8.1
  • transformers 4.5.0
  • torch_scatter 2.0.7
  • records
  • babel
  • tabulate

Data

In our experiments, we used WikiSQL, ESQL as benchmarks, and WikiTableQuestions as semi-supervised data. All of which can be downloaded by here. After obtaining the data, make a new file named "data" in root directory, and put the data into that file.

Train

1. WikiSQL

Execute the following command for training ST-SQL on WikiSQL.

python main.py --conf conf/wikisql.conf

2. ESQL

Put the Chinese version of RoBERTa in the appropriate directory and modify the settings in util.py. Execute the following command for training ST-SQL on ESQL.

python main.py --conf conf/esql.conf

The pre-training model can be changed following the weight_name in util.py. If you want to train the model on few-shot or zero-shot setting, the data path and some parameters mentioned in our paper need to be changed as well.

Test

If you want to test the model with Execution Guiding(EG), and use Logical Form accuracy(LF) and Execution accuracy(EX), use following command after modifying some parameters in the code.

python wikisql_prediction.py

If you want to test fast without EG and EX, run following command.

python wikisql_prediction_simple.py

About

text-to-SQL with Semi-Supervised Learning and Meta-learning

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%