检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:刘洋 廖薇 徐震 Liu Yang;Liao Wei;Xu Zhen(School of Electronic&Electrical Engineering,Shanghai University of Engineering Science,Shanghai 201620,China;School of Mechanical&Automotive Engineering,Shanghai University of Engineering Science,Shanghai 201620,China)
机构地区:[1]上海工程技术大学电子电气工程学院,上海201620 [2]上海工程技术大学机械与汽车工程学院,上海201620
出 处:《计算机应用研究》2024年第9期2800-2804,共5页Application Research of Computers
基 金:国家自然科学基金资助项目(62001282)。
摘 要:现有的自然语言转SQL(NL2SQL)方法没有充分利用数据表的字段信息,而这对于问题的语义理解和SQL语句的逻辑生成有着重要作用。为了提高SQL生成的整体准确性,提出一种融合数据表字段的NL2SQL方法(FC-SQL)。首先,利用BERT预训练模型对问题和数据库表字段进行合并编码表示;其次,采用多任务学习的方式,结合并联和级联的方式构建多任务网络,以预测不同子任务;最后,针对条件值提取子任务,通过融合字段信息计算问题中词与表字段的相似度,并以相似度值作为权重来计算每个词语作为条件值的概率,从而提高条件值预测的准确率。在TableQA数据集上的逻辑形式准确率与SQL执行准确率分别达到88.23%和91.65%。设计消融实验验证表字段信息对于模型的影响,实验结果表明融入表字段后,条件值抽取子任务效果有所提升,进而改善了NL2SQL任务的整体准确率,相较于对比模型有更好的SQL生成效果。Existing NL2SQL approaches do not fully utilize the information of data table columns,which plays an important role in the semantic understanding of the problem and the logical generation of SQL statements.This paper proposed an NL2SQL method that fused data table columns(FC-SQL)to improve the overall accuracy of SQL generation.Firstly,this method utilized BERT to merge the problem and database table columns for encoded representations.Secondly,it used multi-task learning approach to construct a multi-task network by combining parallel and cascade to predict different sub-tasks.Finally,for the conditional value extraction sub-task,this method computed the similarity between the words in the problem and the table columns by fusing the information of the columns,and it used the similarity value as a weight to compute each word as the conditional value probability of each word as a conditional value,thus improving the accuracy of conditional value prediction.The logical form accuracy and SQL execution accuracy on the TableQA dataset reach 88.23%and 91.65%,respectively.This paper designed ablation experiments to verify the effect of table columns information on the model.The experimental results show that the incorporation of table columns improves the effectiveness of the conditional value extraction sub-task,which in turn improves the overall accuracy of the NL2SQL task and provides better SQL generation compared to the comparison model.
关 键 词:多任务学习 自然语言转SQL 自然语言处理 表字段
分 类 号:TP391[自动化与计算机技术—计算机应用技术]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:18.220.204.192