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.
翻译:文本到 SQL 的最新最佳尝试之一是先期培训的语言模式。 由于 SQL 查询的结构属性, 后继2seq 模式负责对 schema 项目( 即表格和列) 和骨架( 即 SQL 关键词) 进行分解。 这种组合目标增加了对正确的 SQL 查询进行分解的难度, 特别是当它们涉及许多系统项目和逻辑操作员时。 本文提议了一个分级强化编码和骨架- 识破框架, 以解析 SQL 的连接和骨架解析。 具体来说, 后继2seq 编码- decoder- decodecode 模型, 其编码器由最相关的 schema 项目( 即表格和列栏目) 和骨架( 即 SQL ) 输入最相关的 schema, 能够减轻 SQL 和 SARVA/ 显示我们稳定的 SARVA/D 。