Skip to content

"UniSAr: A Unified Structure-Aware Autoregressive Language Model for Text-to-SQL"

Notifications You must be signed in to change notification settings

612twilight/UniSAr_text2sql

Repository files navigation

国网人工智能竞赛冠军

Introduction

This paper introduces UniSAr.

Dataset and Model

Spider -> ./data/spider

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

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.

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

About

"UniSAr: A Unified Structure-Aware Autoregressive Language Model for Text-to-SQL"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published