基于树状模型的复杂自然语言查询转SQL技术研究
作者:
作者单位:

作者简介:

赵猛(1997-),男,硕士,主要研究领域为语义解析,自然语言处理;伍赛(1980-),男,博士,教授,博士生导师,CCF专业会员,主要研究领域为分布式数据库检索和查询,大数据分析处理,基于机器学习的数据库智能化算法;陈珂(1977-),女,博士,副研究员,CCF专业会员,主要研究领域为数据库系统,大数据技术,隐私保护;陈刚(1973-),男,博士,教授,博士生导师,CCF杰出会员,主要研究领域为数据库系统,大数据技术,数据智能计算;寿黎但(1974-),男,博士,教授,博士生导师,CCF高级会员,主要研究领域为数据库系统,数据智能技术,数据挖掘

通讯作者:

陈珂,E-mail:chenk@zju.edu.cn

中图分类号:

TP311

基金项目:

浙江省重点研发计划(2021C01009);国家自然科学基金(62050099);高校基本科研业务费专项


Converting Complex Natural Language Query to SQL Based on Tree Representation Model
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    自然语言查询转SQL (NL2SQL)是指将自然语言表达的查询文本自动转化成数据库系统可以理解并执行的结构化查询语言SQL表达式的技术.NL2SQL可以为普通用户提供数据库查询访问的自然交互界面,从而实现基于数据库的自然问答.复杂查询的NL2SQL是当前数据库学术界的研究热点,主流方法采用序列到序列(Seq2seq)的编解码方式对问题进行建模.然而,已有的工作大多基于英文场景,面向中文领域实际应用时,中文特殊的口语化表达导致复杂查询转化困难;此外,现有工作难以正确输出包含复杂计算表达式的查询子句.针对上述问题,提出一种树状模型取代序列表示,将复杂查询自顶向下分解为多叉树,树结点代表SQL的各组成元素,采用深度优先搜索来预测生成SQL语句.在DuSQL中文NL2SQL竞赛的两个官方测试集中,该方法分别取得了第1名和第2名的成绩,验证了其有效性.

    Abstract:

    NL2SQL refers to a technology that automatically converts query expressed in natural language into a structured SQL expression, which can be parsed and executed by the DBMS. NL2SQL can provide ordinary users with a natural interactive interface for database query access, thereby realizing question-answering atop database systems. NL2SQL for complex queries is now a research hotspot in the database community. The most prevalent approach uses the sequence-to-sequence (Seq2seq) encoder and decoder to convert complex natural language to SQL. However, most of the existing work focuses on English language. This approach is not ready to address the special colloquial expressions in Chinese queries. In addition, the existing work cannot correctly output query clauses containing complex calculation expressions. To solve the above problems, this study proposes to use a tree model instead of the sequence representation. The proposed approach disassembles complex queries from top to down to comprise a multi-way tree, where the tree nodes represent the elements of SQL. It uses a depth-first search to predict and generate SQL statements. The proposed approach has achieved the championship and 1st runner-up in two official tests of DuSQL Chinese NL2SQL Competition. The experimental results confirm the effectiveness of the proposed approach.

    参考文献
    相似文献
    引证文献
引用本文

赵猛,陈珂,寿黎但,伍赛,陈刚.基于树状模型的复杂自然语言查询转SQL技术研究.软件学报,2022,33(12):4727-4745

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2021-01-27
  • 最后修改日期:2021-12-15
  • 录用日期:
  • 在线发布日期: 2022-05-24
  • 出版日期: 2022-12-06
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京市海淀区中关村南四街4号,邮政编码:100190
电话:010-62562563 传真:010-62562533 Email:jos@iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号