Giter Site home page Giter Site logo

mst-sql's Introduction

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

mst-sql's People

Contributors

ygxw0909 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.