Giter Site home page Giter Site logo

unisar_text2sql's Introduction

Introduction

This paper introduces UniSAr.

Dataset and Model

Spider -> ./data/spider

Fine-tuned BART model -> ./models/spider_sl

(Please download this model by git-lfs to avoid the issue.)

git lfs install
git clone https://huggingface.co/dreamerdeo/mark-bart

Main dependencies

  • Python version >= 3.6
  • PyTorch version >= 1.5.0
  • pip install -r requirements.txt
  • fairseq is going though changing without backward compatibility. Install fairseq from source and use this commit for reproducibilty. See here for the current PR that should fix fairseq/master.

(Since the constrained decoding is implemented base on GENRE, please install the specific fairseq version as README suggested.)

git clone [email protected]:nicola-decao/fairseq.git
cd fairseq
pip install --editable ./

Evaluation Pipeline

Step 1: Preprocess via adding schema-linking and value-linking tag.

python step1_schema_linking.py

Step 2: Building the input and output for BART.

python step2_serialization.py

Step 3: Evaluation Script with/without constrained decoding.

python step3_evaluate.py --constrain

Results

Prediction: 69.34

Prediction with Constrain Decoding: 70.02

Interactive

python interactive.py --logdir ./models/spider-sl --db_id student_1 --db-path ./data/spider/database --schema-path ./data/spider/tables.json

Reference Code

https://github.com/ryanzhumich/editsql

https://github.com/benbogin/spider-schema-gnn-global

https://github.com/ElementAI/duorat

https://github.com/facebookresearch/GENRE

unisar_text2sql's People

Contributors

longxudou 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.