作为第一个会话级的中文数据集,Chase包含两个单独的部分,即从Scratch(Chase-C)手动构建的2,003个会话,以及从英语SPARC(Chase-T)翻译的3,456个会话。我们发现这两个部分是高度差异,并且作为培训和评估数据不兼容。在这项工作中,我们介绍了SESQL,这是中文的另一个大规模会话级文本到SQL数据集,由5,028个会话组成,所有课程都是从Scratch手动构建的。为了保证数据质量,我们采用迭代注释工作流程,以促进对先前的自然语言(NL)问题和SQL查询的紧张和及时审查。此外,通过完成所有与上下文有关的NL问题,我们获得了27,012个独立的问题/SQL对,允许SESQL用作单轮多DB文本到SQL解析的最大数据集。我们通过使用三个竞争性会话级解析器,并提供详细的分析,对SESQL进行基准测试级文本到SQL解析实验。
translated by 谷歌翻译
We present Spider, a large-scale, complex and cross-domain semantic parsing and textto-SQL dataset annotated by 11 college students. It consists of 10,181 questions and 5,693 unique complex SQL queries on 200 databases with multiple tables, covering 138 different domains. We define a new complex and cross-domain semantic parsing and textto-SQL task where different complex SQL queries and databases appear in train and test sets. In this way, the task requires the model to generalize well to both new SQL queries and new database schemas. Spider is distinct from most of the previous semantic parsing tasks because they all use a single database and the exact same programs in the train set and the test set. We experiment with various state-of-the-art models and the best model achieves only 12.4% exact matching accuracy on a database split setting. This shows that Spider presents a strong challenge for future research. Our dataset and task are publicly available at https://yale-lily. github.io/spider.
translated by 谷歌翻译
文本到SQL解析是一项必不可少且具有挑战性的任务。文本到SQL解析的目的是根据关系数据库提供的证据将自然语言(NL)问题转换为其相应的结构性查询语言(SQL)。来自数据库社区的早期文本到SQL解析系统取得了显着的进展,重度人类工程和用户与系统的互动的成本。近年来,深层神经网络通过神经生成模型显着提出了这项任务,该模型会自动学习从输入NL问题到输出SQL查询的映射功能。随后,大型的预训练的语言模型将文本到SQL解析任务的最新作品带到了一个新级别。在这项调查中,我们对文本到SQL解析的深度学习方法进行了全面的评论。首先,我们介绍了文本到SQL解析语料库,可以归类为单转和多转。其次,我们提供了预先训练的语言模型和现有文本解析方法的系统概述。第三,我们向读者展示了文本到SQL解析所面临的挑战,并探索了该领域的一些潜在未来方向。
translated by 谷歌翻译
学习捕获文本表对齐对于文本到SQL等任务至关重要。一个模型需要正确识别对列和值的自然语言引用,并在给定的数据库架构中将其扎根。在本文中,我们为文本到SQL提出了一个新颖的弱监督结构接地预处理框架(strug),可以有效地学习基于平行的文本表语料库来捕获文本表对齐。我们确定了一组新的预测任务:列接地,价值接地和列值映射,并利用它们为文本表编码预处理。此外,为了评估更现实的文本表对齐设置下的不同方法,我们基于蜘蛛dev设置的新评估集蜘蛛现实化,并明确提及已删除的列名,并采用八个现有的文本到SQL数据集以进行交叉 - 数据库评估。在所有设置中,Strug对Bert-Large都有显着改善。与现有的预训练方法(例如Grappa)相比,Strug在蜘蛛方面的性能相似,并且在更现实的集合上都优于所有基线。蜘蛛现实的数据集可从https://doi.org/10.5281/zenodo.5205322获得。
translated by 谷歌翻译
文本到SQL引起了自然语言处理和数据库社区的关注,因为它能够将自然语言中的语义转换为SQL查询及其在构建自然语言接口到数据库系统中的实际应用。文本到SQL的主要挑战在于编码自然话语的含义,解码为SQL查询,并翻译这两种形式之间的语义。这些挑战已被最近的进步解决了不同的范围。但是,对于这项任务仍缺乏全面的调查。为此,我们回顾了有关数据集,方法和评估的文本到SQL的最新进展,并提供了这项系统的调查,解决了上述挑战并讨论潜在的未来方向。我们希望这项调查可以作为快速获取现有工作并激励未来的研究。
translated by 谷歌翻译
In this paper, we study the problem of knowledge-intensive text-to-SQL, in which domain knowledge is necessary to parse expert questions into SQL queries over domain-specific tables. We formalize this scenario by building a new Chinese benchmark KnowSQL consisting of domain-specific questions covering various domains. We then address this problem by presenting formulaic knowledge, rather than by annotating additional data examples. More concretely, we construct a formulaic knowledge bank as a domain knowledge base and propose a framework (ReGrouP) to leverage this formulaic knowledge during parsing. Experiments using ReGrouP demonstrate a significant 28.2% improvement overall on KnowSQL.
translated by 谷歌翻译
随着未来以数据为中心的决策,对数据库的无缝访问至关重要。关于创建有效的文本到SQL(Text2SQL)模型以访问数据库的数据有广泛的研究。使用自然语言是可以通过有效访问数据库(尤其是对于非技术用户)来弥合数据和结果之间差距的最佳接口之一。它将打开门,并在精通技术技能或不太熟练的查询语言的用户中引起极大的兴趣。即使提出或研究了许多基于深度学习的算法,在现实工作场景中使用自然语言来解决数据查询问题仍然非常具有挑战性。原因是在不同的研究中使用不同的数据集,这带来了其局限性和假设。同时,我们确实缺乏对这些提议的模型及其对其训练的特定数据集的局限性的彻底理解。在本文中,我们试图介绍过去几年研究的24种神经网络模型的整体概述,包括其涉及卷积神经网络,经常性神经网络,指针网络,强化学习,生成模型等的架构。我们还概述11个数据集,这些数据集被广泛用于训练Text2SQL技术的模型。我们还讨论了无缝数据查询中文本2SQL技术的未来应用可能性。
translated by 谷歌翻译
Computational notebooks, such as Jupyter notebooks, are interactive computing environments that are ubiquitous among data scientists to perform data wrangling and analytic tasks. To measure the performance of AI pair programmers that automatically synthesize programs for those tasks given natural language (NL) intents from users, we build ARCADE, a benchmark of 1082 code generation problems using the pandas data analysis framework in data science notebooks. ARCADE features multiple rounds of NL-to-code problems from the same notebook. It requires a model to understand rich multi-modal contexts, such as existing notebook cells and their execution states as well as previous turns of interaction. To establish a strong baseline on this challenging task, we develop PaChiNCo, a 62B code language model (LM) for Python computational notebooks, which significantly outperforms public code LMs. Finally, we explore few-shot prompting strategies to elicit better code with step-by-step decomposition and NL explanation, showing the potential to improve the diversity and explainability of model predictions.
translated by 谷歌翻译
The robustness of Text-to-SQL parsers against adversarial perturbations plays a crucial role in delivering highly reliable applications. Previous studies along this line primarily focused on perturbations in the natural language question side, neglecting the variability of tables. Motivated by this, we propose the Adversarial Table Perturbation (ATP) as a new attacking paradigm to measure the robustness of Text-to-SQL models. Following this proposition, we curate ADVETA, the first robustness evaluation benchmark featuring natural and realistic ATPs. All tested state-of-the-art models experience dramatic performance drops on ADVETA, revealing models' vulnerability in real-world practices. To defend against ATP, we build a systematic adversarial training example generation framework tailored for better contextualization of tabular data. Experiments show that our approach not only brings the best robustness improvement against table-side perturbations but also substantially empowers models against NL-side perturbations. We release our benchmark and code at: https://github.com/microsoft/ContextualSP.
translated by 谷歌翻译
Text-to-SQL semantic parsing is an important NLP task, which greatly facilitates the interaction between users and the database and becomes the key component in many human-computer interaction systems. Much recent progress in text-to-SQL has been driven by large-scale datasets, but most of them are centered on English. In this work, we present MultiSpider, the largest multilingual text-to-SQL dataset which covers seven languages (English, German, French, Spanish, Japanese, Chinese, and Vietnamese). Upon MultiSpider, we further identify the lexical and structural challenges of text-to-SQL (caused by specific language properties and dialect sayings) and their intensity across different languages. Experimental results under three typical settings (zero-shot, monolingual and multilingual) reveal a 6.1% absolute drop in accuracy in non-English languages. Qualitative and quantitative analyses are conducted to understand the reason for the performance drop of each language. Besides the dataset, we also propose a simple schema augmentation framework SAVe (Schema-Augmentation-with-Verification), which significantly boosts the overall performance by about 1.8% and closes the 29.5% performance gap across languages.
translated by 谷歌翻译
Recently, there has been increasing interest in synthesizing data to improve downstream text-to-SQL tasks. In this paper, we first examined the existing synthesized datasets and discovered that state-of-the-art text-to-SQL algorithms did not further improve on popular benchmarks when trained with augmented synthetic data. We observed two shortcomings: illogical synthetic SQL queries from independent column sampling and arbitrary table joins. To address these issues, we propose a novel synthesis framework that incorporates key relationships from schema, imposes strong typing, and conducts schema-distance-weighted column sampling. We also adopt an intermediate representation (IR) for the SQL-to-text task to further improve the quality of the generated natural language questions. When existing powerful semantic parsers are pre-finetuned on our high-quality synthesized data, our experiments show that these models have significant accuracy boosts on popular benchmarks, including new state-of-the-art performance on Spider.
translated by 谷歌翻译
The task of text-to-SQL is to convert a natural language question to its corresponding SQL query in the context of relational tables. Existing text-to-SQL parsers generate a "plausible" SQL query for an arbitrary user question, thereby failing to correctly handle problematic user questions. To formalize this problem, we conduct a preliminary study on the observed ambiguous and unanswerable cases in text-to-SQL and summarize them into 6 feature categories. Correspondingly, we identify the causes behind each category and propose requirements for handling ambiguous and unanswerable questions. Following this study, we propose a simple yet effective counterfactual example generation approach for the automatic generation of ambiguous and unanswerable text-to-SQL examples. Furthermore, we propose a weakly supervised model DTE (Detecting-Then-Explaining) for error detection, localization, and explanation. Experimental results show that our model achieves the best result on both real-world examples and generated examples compared with various baselines. We will release data and code for future research.
translated by 谷歌翻译
最近的语言模型预培训进展取得了巨大的成功,通过利用大规模的非结构化文本数据。然而,由于没有大规模的高质量表格数据,在结构化的表格数据上应用预先培训仍然是一项挑战。在本文中,我们提出了Tapex,以表明通过在合成语料库上学习神经SQL执行程序来实现表预培训,这是通过自动合成可执行的SQL查询和执行输出来获得的。 Tapex通过引导语言模型来模仿SQL执行程序的不同,大规模和高质量的合成语料库来解决数据稀缺性挑战。我们在四个基准数据集中评估Tapex。实验结果表明,Tapex优于以前的表格预训练,并通过大幅度达到了新的最先进的结果。这包括改进弱监管的WikiSQL表示精度为89.5%(+ 2.3%),WikityQuestions表示精度为57.5%(+ 4.8%),SQA表示精度为74.5%(+ 3.5%)和Tabfact精度84.2%(+ 3.2%)。为了我们的知识,这是通过合成可执行程序利用表预培训的第一项工作,并在各种下游任务上实现新的最先进结果。
translated by 谷歌翻译
为了实现长文档理解的构建和测试模型,我们引入质量,具有中文段的多项选择QA DataSet,具有约5,000个令牌的平均长度,比典型的当前模型更长。与经过段落的事先工作不同,我们的问题是由阅读整个段落的贡献者编写和验证的,而不是依赖摘要或摘录。此外,只有一半的问题是通过在紧缩时间限制下工作的注释器来应答,表明略读和简单的搜索不足以一直表现良好。目前的模型在此任务上表现不佳(55.4%),并且落后于人类性能(93.5%)。
translated by 谷歌翻译
本文旨在通过探索基于神经网络的方法(称为Sun)中的内在不确定性来提高文本到SQL解析的性能。从数据不确定性的角度来看,可以从多个语义等效的问题中学到单个SQL。从以前仅限于一对一映射的方法中不同,我们提出了一个数据不确定性限制来探索潜在的互补语义语义多个语义等效问题(多对一)中的信息,并以减少的虚假关联来学习稳健的特征表示。通过这种方式,我们可以降低学习表示的敏感性并改善解析器的鲁棒性。从模型的不确定性角度来看,神经网络的权重之间通常存在结构信息(依赖性)。为了提高神经文本到SQL解析器的普遍性和稳定性,我们提出了模型不确定性约束,以通过强制执行不同扰动编码网络的输出表示形式来完善查询表示形式,以使其彼此一致。在五个基准数据集上进行的广泛实验表明,我们的方法显着优于强大的竞争对手,并实现了新的最新结果。为了获得可重复性,我们在https://github.com/alibabaresearch/damo-convai/tree/main/main/sunsql上发布代码和数据。
translated by 谷歌翻译
最近训练模型通过利用大规模文本语料库来改善神经网络的上下文表示能力,显着提高了各种NLP任务的性能。大型预培训语言模型也已应用于表语义解析的区域。然而,现有的预训练方法没有仔细探索问题与相应的数据库模式之间的明确互动关系,这是揭示其语义和结构对应的关键成分。此外,在架构接地背景下的问知表示学习在预训练目标中受到更少的关注。为了减轻这些问题,本文设计了两种新的预训练目标,将所需的归纳偏差将所需的归纳偏差施加到表前的学习表现-训练。我们进一步提出了一种模式感知课程学习方法来减轻噪声的影响,并以易于努力的方式从预训练数据中学习。我们通过在两个基准,蜘蛛和罢工中进行微调,评估我们预先接受训练的框架。结果表明,与各种基线相比,我们的预训练目标和课程的有效性。
translated by 谷歌翻译
数据增强是自然语言处理(NLP)模型的鲁棒性评估的重要组成部分,以及增强他们培训的数据的多样性。在本文中,我们呈现NL-Cogmenter,这是一种新的参与式Python的自然语言增强框架,它支持创建两个转换(对数据的修改)和过滤器(根据特定功能的数据拆分)。我们描述了框架和初始的117个变换和23个过滤器,用于各种自然语言任务。我们通过使用其几个转换来分析流行自然语言模型的鲁棒性来证明NL-Upmenter的功效。基础架构,Datacards和稳健性分析结果在NL-Augmenter存储库上公开可用(\ url {https://github.com/gem-benchmark/nl-augmenter})。
translated by 谷歌翻译
长期以来,可以将可以应用于新数据库的文本到SQL解析器的重要性已得到认可,实现此目标的关键步骤是架构链接,即在生成SQL时正确地识别未见列或表的提及。在这项工作中,我们提出了一个新颖的框架,以通过基于PoinCar \'e距离指标的探测程序从大规模预训练的语言模型(PLM)中引起关系结构,并使用诱导的关系来增强基于图的解析器为了更好的模式链接。与常用的基于规则的架构链接方法相比,我们发现探测关系也可以稳健地捕获语义对应关系,即使提及和实体的表面形式不同。此外,我们的探测过程完全不受监督,不需要其他参数。广泛的实验表明,我们的框架在三个基准测试中设定了新的最新性能。我们从经验上验证我们的探测程序确实可以通过定性分析找到所需的关系结构。
translated by 谷歌翻译
基于语音的投入在我们日常生活中获得了智能手机和平板电脑的普及,因为声音是人类计算机交互的最简单而有效的方式。本文旨在设计更有效的基于语音的接口,以查询关系数据库中的结构化数据。我们首先识别名为Speep-to-SQL的新任务,旨在了解人类语音传达的信息,并直接将其转换为结构化查询语言(SQL)语句。对此问题的天真解决方案可以以级联方式工作,即,自动语音识别(ASR)组件,后跟文本到SQL组件。然而,它需要高质量的ASR系统,并且还遭受了两种组件之间的错误复合问题,从而产生有限的性能。为了处理这些挑战,我们进一步提出了一个名为SpeepSQLNET的新型端到端神经结构,直接将人类语音转化为没有外部ASR步骤的SQL查询。 SpeemSQLNET具有充分利用演讲中提供的丰富语言信息的优势。据我们所知,这是第一次尝试根据任意自然语言问题直接综合SQL,而不是基于自然语言的SQL版本或其具有有限的SQL语法的变体。为了验证所提出的问题和模型的有效性,我们还通过捎带广泛使用的文本到SQL数据集来进一步构建名为SpeemQL的数据集。对该数据集的广泛实验评估表明,SpeemSQLNET可以直接从人类语音中直接综合高质量的SQL查询,优于各种竞争对手,以及在精确匹配的准确性方面的级联方法。
translated by 谷歌翻译
最近,神经技术已用于自动生成源代码。这些方法在有望获得声明语言的同时,在命令式语言的数据集上的性能差得多。由于通常将声明性语言嵌入了现实世界软件开发中的命令式语言(即Turducken式编程)中,因此声明语言的有希望的结果几乎不会导致手动软件开发工作大幅减少。在本文中,我们定义了一项新的代码生成任务:鉴于自然语言评论,此任务旨在用嵌入式声明语言以基本命令性语言生成程序。据我们所知,这是第一个Turducken风格的代码生成任务。对于此任务,我们将Lyra:Python中的数据集提出了嵌入式SQL。该数据集包含来自现实世界项目的2,000个精心注释的数据库操作程序。每个程序都与中文评论和英文评论配对。在我们的实验中,我们采用了变压器,伯特风格和GPT风格的模型作为基础。在最佳环境中,GPT风格模型的生成性能比其他模型更好,在使用中文和英语评论时,AST精确匹配的精度分别为24%和25.5%。因此,我们认为Lyra为代码生成提供了新的挑战。但是,克服这一挑战可能会大大提高代码生成技术在现实世界软件开发中的适用性。
translated by 谷歌翻译