Coder Social home page Coder Social logo

microsoft / text-to-sql-schema-expansion-generalization Goto Github PK

View Code? Open in Web Editor NEW
13.0 6.0 2.0 17.16 MB

Bridging the Generalization Gap in Text-to-SQL Parsing with Schema Expansion

License: Other

Python 79.60% Dockerfile 0.08% Jsonnet 20.13% Shell 0.19%

text-to-sql-schema-expansion-generalization's Introduction

Bridging the Generalization Gap in Text-to-SQL Parsing with Schema Expansion

Code and data release for this ACL 2022 paper.

Schema Pruning

Install pytorch 1.8.2 that fits your CUDA version.

For schema pruning, the Synthetic dataset is under the folder data/syn_exp, and Squall data is data/syn_exp/train_data_prune.json and data/syn_exp/dev_data_prune.json

Training Command (for Squall):

python -m col-prune.experiment --train-file squall/train_data_prune.json --dev-file squall/dev_data_prune.json --test-file squall/dev_data_prune.json --log-file log_prune.log --pred-file pred_dev.json

Eval Command:

python -m col-prune.experiment --train-file squall/train_data_prune.json --dev-file squall/dev_data_prune.json --test-file squall/dev_data_prune.json --log-file log_prune.log --pred-file pred_dev.json --test

Parsing (Seq2seq)

We follow the repo from the original Squall paper, see here for installation details.

The data used in parsing experiment is preprocessed where each table only contains remained columns after pruning. The Synthetic dataset is under folder data/syn_exp/after_prune, and Squall data is squall/train_data_parser.json and squall/dev_data_parser.json

Command:

Run python main.py --train-file squall/train_data_parser.json --dev-file squall/dev_data_parser.json --test-file squall/dev_data_prune.json --log-file log_parse.log --pred-file pred_dev.json

Parsing (SmBop)

We follow the repo from the original SmBop paper, see here for installation details.

The dataset in under folder smbop/dataset, and all config files are under folder configs/

Command:

python exec.py --name squall --config_f configs/exp4.jsonnet

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Legal Notices

Note that our data release is effectively a repartitioning of the Squall dataset. The Squall dataset is available here under a CC BY-SA 4.0 license, which is available here. The Squall dataset was built upon WikiTableQuestions by Panupong Pasupat and Percy Liang, available here. The WikiTableQuestions dataset is made available pursuant to CC BY-SA 4.0 as well. See https://github.com/ppasupat/WikiTableQuestions/blob/master/LICENSE.

Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the Creative Commons Attribution 4.0 International Public License, see the LICENSE file, and grant you a license to any code in the repository under the MIT License, see the LICENSE-CODE file.

Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.

Privacy information can be found at https://privacy.microsoft.com/en-us/

Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel or otherwise.

text-to-sql-schema-expansion-generalization's People

Contributors

dependabot[bot] avatar eaplatanios avatar microsoft-github-operations[bot] avatar microsoftopensource avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

text-to-sql-schema-expansion-generalization's Issues

Schema Expansion

Hi, I am very interested in your work and I hope to add my own schema expansion templates, but in your code, I didn't find how you expand a given table. I only found "the Synthetic dataset is under the folder data/syn_exp", which seems to already have been expanded. Could you direct me to the part where you apply schema expansion to a raw table schema? Thank you very much!

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.