论文:SeaD: End-to-end Text-to-SQL Generation with Schema-aware Denoising
⭐⭐
NAACL 2022, arXiv:2105.07911
本论文提出 SeaD 模型,使用 schema-aware 的去噪方法来训练一个 end2end、seq2seq 的 Transformer 模型来实现 Text2SQL。
一、论文速读
给定一个 question Q Q Q 和一个 schema S S S,我们期望生成相应的 SQL 查询 Y Y Y。
1.1 model 的输入输出
SeaD 的输入输出如下图所示:
在 input 中,将 table headers 的各个 column name 前面加一个 <col n>
表示第几个 column,然后跟着 column name 和 type,比如对于 week 字段,就是 <col0>week:int
。
在期待的 output 中,SQL 的 column name 使用 “`” 这个 token 围绕,并将 name 换为分隔符 <col n>
,如上图所示。
1.2 Transformer with Pointer
该工作使用 Transformer 作为 backbone 来做 seq2seq 任务。
为什么使用 Transformer with Pointer?在 Text2SQL 任务中,大多数的 schema 和 value mentions 可以从 input seq 中抽取出来,所以在 Transformer 架构的最上面加了一个 Hybrid Pointer Generator Network 来生成 token,生成的 token 来自于 target vocabulary V V V 或者 copy from the input text。
target vocabulary V V V 由三个集合组合而成:
- V q