期刊文献+

面向复杂查询请求的SQL自动生成模型

SQL Automatic Generation Model for Complex Query Requests
下载PDF
导出
摘要 将自然语言自动转换成恰当的SQL语句是基于关系数据库智能问答系统的核心,而一个SQL语句执行后能否得到期望的查询结果在很大程度上取决于where子句的表达是否正确.目前,大多数Text2Sql算法只利用了数据库表的列语义向量来提取where子句中出现的值,但是当where子句中存在多列多值时往往无法准确地提取对应的值.本文提出的一种神经网络模型———2-SQL,将提取where子句中值的方式改进为范式转变模式.通过对运算符和值进行枚举,生成一系列的候选查询条件组合,再采用Transformer模型将查询请求语句与查询条件组合进行语义匹配,来实现对候选查询条件的筛选.实验表明,与现有Text2Sql相比较,2-SQL对复杂查询where子句中出现的值的提取具有较好的效果. Automatic conversion of natural languages into appropriate SQL statements is at the heart of a relational database-based intelligent Q&A system,and whether an SQL statement is executed to achieve the desired query result depends largely on whether the WHERE clause is expressed correctly.Currently,most Text2Sql algorithms only use column semantics vectors of database tables to extract the values that appear in the WHERE clause.However,when there are multiple columns and multiple values in the WHERE clause,the corresponding values are often not accurately extracted.A neural network model,2-SQL,is proposed in this paper to improve the way of extracting the values in the WHERE clause into the paradigm shift mode.Through enumerating operators and values,a series of combination of candidate query conditions are generated,and then Transformer model is adopted to match the combination of query request statements and query conditions semantically,so as to realize the filter of candidate query conditions.Experiments show that compared with Text2Sql,2-SQL has a better effect on extracting the values in the WHERE clause of complex query.
作者 余波 彭敦陆 YU Bo;PENG Dun-lu(School of Optical-Electrical and Computer Engineering,University of Shanghai for Science and Technology,Shanghai 200093,China)
出处 《小型微型计算机系统》 CSCD 北大核心 2021年第11期2446-2451,共6页 Journal of Chinese Computer Systems
基金 国家自然科学基金项目(61772342)资助.
关键词 Text2Sql 数据库问答系统 语义匹配 2-SQL Text2Sql database question answering system semantic matching 2-SQL
  • 相关文献

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部