/DAC

Primary LanguagePython

DAC: Decomposed Automation Correction for Text-to-SQL

This repository contains code for the paper "DAC: Decomposed Automation Correction for Text-to-SQL".

Build Environment

conda create -n dac python=3.9 -y
conda activate dac
pip install requirements.txt

Download and put the Spider, Bird and KaggleDBQA databases in ./dataset.

Download alignment data from https://github.com/microsoft/ContextualSP/tree/master, and change the data path in DAC/result/Spider/scripts.

Implement your openai-key in utils/generator.py if you want to use openai to generate demonstrations.

Text-to-SQL

Use the script of run.sh to generate SQL with our DAC method.

Evaluate

It is recommanded to evaluate the result with https://github.com/taoyds/test-suite-sql-eval.