The SQL-to-text generation task traditionally uses template base, Seq2Seq, tree-to-sequence, and graph-to-sequence models. Recent models take advantage of pre-trained generative language models for this task in the Seq2Seq framework. However, treating SQL as a sequence of inputs to the pre-trained models is not optimal. In this work, we put forward a new SQL intermediate representation called EzSQL to align SQL with the natural language text sequence. EzSQL simplifies the SQL queries and brings them closer to natural language text by modifying operators and keywords, which can usually be described in natural language. EzSQL also removes the need for set operators. Our proposed SQL-to-text generation model uses EzSQL as the input to a pre-trained generative language model for generating the text descriptions. We demonstrate that our model is an effective state-of-the-art method to generate text narrations from SQL queries on the WikiSQL and Spider datasets. We also show that by generating pretraining data using our SQL-to-text generation model, we can enhance the performance of Text-to-SQL parsers.
翻译:SQL到文本生成任务传统上采用基于模板、序列到序列、树到序列和图到序列模型。近期模型在序列到序列框架中利用预训练生成式语言模型来完成此任务。然而,将SQL作为预训练模型的输入序列处理并非最优方案。本工作提出一种名为EzSQL的新型SQL中间表示,旨在将SQL与自然语言文本序列对齐。EzSQL通过修改通常可用自然语言描述的运算符和关键字来简化SQL查询,使其更接近自然语言文本。EzSQL还消除了对集合运算符的需求。我们提出的SQL到文本生成模型使用EzSQL作为预训练生成式语言模型的输入来生成文本描述。我们在WikiSQL和Spider数据集上证明,该模型是当前从SQL查询生成文本描述的最先进有效方法。我们还表明,通过使用我们的SQL到文本生成模型生成预训练数据,能够提升Text-to-SQL解析器的性能。