Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

RESDSQL: Decoupling Schema Linking and Skeleton Parsing for Text-to-SQL

About

One of the recent best attempts at Text-to-SQL is the pre-trained language model. Due to the structural property of the SQL queries, the seq2seq model takes the responsibility of parsing both the schema items (i.e., tables and columns) and the skeleton (i.e., SQL keywords). Such coupled targets increase the difficulty of parsing the correct SQL queries especially when they involve many schema items and logic operators. This paper proposes a ranking-enhanced encoding and skeleton-aware decoding framework to decouple the schema linking and the skeleton parsing. Specifically, for a seq2seq encoder-decode model, its encoder is injected by the most relevant schema items instead of the whole unordered ones, which could alleviate the schema linking effort during SQL parsing, and its decoder first generates the skeleton and then the actual SQL query, which could implicitly constrain the SQL parsing. We evaluate our proposed framework on Spider and its three robustness variants: Spider-DK, Spider-Syn, and Spider-Realistic. The experimental results show that our framework delivers promising performance and robustness. Our code is available at https://github.com/RUCKBReasoning/RESDSQL.

Haoyang Li, Jing Zhang, Cuiping Li, Hong Chen• 2023

Related benchmarks

TaskDatasetResultRank
Text-to-SQLSpider (test)
Execution Accuracy79.9
140
Text-to-SQLSpider (dev)
EX (All)84.1
100
Text-to-SQLSpider 1.0 (dev)--
92
Text-to-SQLSpider 1.0 (test)
EM Acc (Overall)79.9
91
Text-to-SQLSpider hidden (test)
Exact Match (EM)72
10
Text-to-SQLSpider-Realistic 1.0 (test)
Exact Match (EM)77.4
9
Text-to-SQLSpider-Syn 1.0 (test)
Exact Match69.1
7
Text-to-SQLSpider Robustness Suite SYN REALISTIC DK (dev)
Execution Accuracy (SYN)76.9
6
Text-to-SQLSpider-DK 1.0 (test)
EM53.3
5
Showing 9 of 9 rows

Other info

Code

Follow for update