A practical text-to-SQL system should generalize well on a wide variety of natural language questions, unseen database schemas, and novel SQL query structures. To comprehensively evaluate text-to-SQL systems, we introduce a \textbf{UNI}fied benchmark for \textbf{T}ext-to-SQL \textbf{E}valuation (UNITE). It is composed of publicly available text-to-SQL datasets, containing natural language questions from more than 12 domains, SQL queries from more than 3.9K patterns, and 29K databases. Compared to the widely used Spider benchmark \cite{yu-etal-2018-spider}, we introduce $\sim$120K additional examples and a threefold increase in SQL patterns, such as comparative and boolean questions. We conduct a systematic study of six state-of-the-art (SOTA) text-to-SQL parsers on our new benchmark and show that: 1) Codex performs surprisingly well on out-of-domain datasets; 2) specially designed decoding methods (e.g. constrained beam search) can improve performance for both in-domain and out-of-domain settings; 3) explicitly modeling the relationship between questions and schemas further improves the Seq2Seq models. More importantly, our benchmark presents key challenges towards compositional generalization and robustness issues -- which these SOTA models cannot address well. \footnote{Our code and data processing script will be available at \url{https://github.com/XXXX.}}
翻译:一个实用的文本到SQL系统应能在多种自然语言问题、未见过的数据库模式及新颖的SQL查询结构上具有良好的泛化能力。为全面评估文本到SQL系统,我们提出了一个面向文本到SQL评估的统一基准(UNITE)。该基准由公开可用的文本到SQL数据集组成,包含来自12个以上领域的自然语言问题、超过3900种模式的SQL查询语句以及29000个数据库。与广泛使用的Spider基准相比,我们新增了约12万个样本,并将SQL模式(如比较型和布尔型问题)的数量提升三倍。我们在新基准上对六种最先进的(SOTA)文本到SQL解析器进行了系统性研究,结果表明:1)Codex在域外数据集上表现惊人;2)专用解码方法(如约束波束搜索)可同时提升域内和域外场景的性能;3)明确建模问题与模式之间的关系进一步改进了Seq2Seq模型。更重要的是,我们的基准揭示了这些SOTA模型尚无法有效解决的组合泛化与鲁棒性关键挑战。