引用本文: | 胡亚红,刘亚冬,朱正东,等.辅助任务增强的中文跨域NL2SQL算法.[J].国防科技大学学报,2024,46(2):197-204.[点击复制] |
HU Yahong,LIU Yadong,ZHU Zhengdong,et al.Chinese cross-domain NL2SQL algorithm enhanced by auxiliary task[J].Journal of National University of Defense Technology,2024,46(2):197-204[点击复制] |
|
|
|
本文已被:浏览 3126次 下载 1830次 |
辅助任务增强的中文跨域NL2SQL算法 |
胡亚红1,刘亚冬2,朱正东3,刘鹏杰3 |
(1. 浙江工业大学 计算机科学与技术学院, 浙江 杭州 310023;2. 西安交通大学 软件学院, 陕西 西安 710049;3. 西安交通大学 计算机科学与技术学院, 陕西 西安 710049)
|
摘要: |
自然语言到结构化查询语言(natural language to structured query language,NL2SQL)任务旨在将自然语言询问转化为数据库可执行的结构化查询语言(structured query language,SQL) 语句。本文提出了一种辅助任务增强的中文跨域 NL2SQL 算法,其核心思想是通过在解码阶段添加辅助任务以结合原始模型来进行多任务训练,提升模型的准确率。辅助任务的设计是通过将数据库模式建模成图,预测自然语言询问与数据库模式图中的节点的依赖关系,显式地建模自然语言询问和数据库模式之间的依赖关系。针对特定的自然语言询问,通过辅助任务的提升,模型能够更好地识别数据库模式中哪些表/列对预测目标 SQL 更有效。在中文 NL2SQL 数据集 DuSQL 上的实验结果表明,添加辅助任务后的算法相对于原始模型取得了更好的效果,能够更好地处理跨域 NL2SQL 任务。 |
关键词: 人工智能 深度学习 自然语言处理 语义解析 |
DOI:10.11887/j.cn.202402020 |
投稿日期:2022-01-18 |
基金项目:国家重点研发计划资助项目(2018YFB0204003,2018YFB0204004) |
|
Chinese cross-domain NL2SQL algorithm enhanced by auxiliary task |
HU Yahong1, LIU Yadong2, ZHU Zhengdong3, LIU Pengjie3 |
(1. College of Computer Science and Technology, Zhejiang University of Technology, Hangzhou 310023, China;2. School of Software Engineering, Xi′an Jiaotong University, Xi′an 710049, China;3. School of Computer Science and Technology, Xi′an Jiaotong University, Xi′an 710049, China)
|
Abstract: |
NL2SQL(natural language to structured query language) task aims to translate natural language queries into SQL(structured query language) executable by the database. A Chinese cross-domain NL2SQL algorithm enhanced by auxiliary tasks was proposed. Core idea was to perform multi-task training and improve the accuracy of the model by adding auxiliary tasks in the decoder and combining the prototype model. Auxiliary task was designed by modeling the database schema into a graph, predicting the dependency relations between the natural language queries and the nodes in the database schema graph, and explicitly modeling the dependency relations between the natural language query and the database schema. Through the improvement of auxiliary tasks, the model can better identify which tables/columns in the database schema are more effective for predicting the target SQL for specific natural language queries. Experimental results on the Chinese NL2SQL dataset DuSQL show that the algorithm after adding auxiliary tasks has achieved better results than the prototype model, and can better handle cross-domain NL2SQL task. |
Keywords: artificial intelligence deep learning natural language processing semantic parsing |
|
|
|
|
|