基于检索增强生成(RAG)的Text2SQL商业智能系统

IF 1.8 Q3 COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS
Jie Liu, Shiwei Chu
{"title":"基于检索增强生成(RAG)的Text2SQL商业智能系统","authors":"Jie Liu,&nbsp;Shiwei Chu","doi":"10.1002/eng2.70249","DOIUrl":null,"url":null,"abstract":"<p>Modern enterprises increasingly depend on data-driven decision-making, yet traditional SQL queries require technical expertise, limiting accessibility for nonspecialists. Advances in natural language processing, particularly deep learning generative models, have enabled text-to-SQL (text2SQL) conversion, making database interaction more intuitive. Retrieval-Augmented Generation (RAG) enhances this by integrating retrieval and generation for greater accuracy and relevance. This article proposes a text2SQL business intelligence system based on RAG, allowing enterprise users to extract insights from complex databases using natural language queries. By streamlining data retrieval and lowering technical barriers, the system achieves state-of-the-art performance in generating SQL queries for complex tasks. It leverages the BERT (Bidirectional Encoder Representations from Transformers) model for vectorized retrieval, Generative Pretrained Transformer 4 (GPT-4) for query generation, and Graph Neural Networks (GNNs) for modeling database structures. User interaction and feedback mechanisms further refine semantic understanding and query accuracy. Experimental results demonstrate the system's effectiveness. For multitable joins, query matching accuracy using BERT + GPT-4 + GNN reaches 52.3% and 55.1% with beam widths of 1 and 10, respectively. For nested queries involving multitable joins, accuracy increases to 60.2% and 61.9% under the same conditions. Additionally, the system achieves the highest user satisfaction scores, validating its practical utility. By enhancing the ability to handle complex queries and reducing data access barriers, the proposed RAG-based text2SQL system provides enterprise users with an efficient, user-friendly tool for database interaction, significantly improving decision-making processes.</p>","PeriodicalId":72922,"journal":{"name":"Engineering reports : open access","volume":"7 6","pages":""},"PeriodicalIF":1.8000,"publicationDate":"2025-06-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://onlinelibrary.wiley.com/doi/epdf/10.1002/eng2.70249","citationCount":"0","resultStr":"{\"title\":\"Text2SQL Business Intelligence System Based on Retrieval-Augmented Generation (RAG)\",\"authors\":\"Jie Liu,&nbsp;Shiwei Chu\",\"doi\":\"10.1002/eng2.70249\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<p>Modern enterprises increasingly depend on data-driven decision-making, yet traditional SQL queries require technical expertise, limiting accessibility for nonspecialists. Advances in natural language processing, particularly deep learning generative models, have enabled text-to-SQL (text2SQL) conversion, making database interaction more intuitive. Retrieval-Augmented Generation (RAG) enhances this by integrating retrieval and generation for greater accuracy and relevance. This article proposes a text2SQL business intelligence system based on RAG, allowing enterprise users to extract insights from complex databases using natural language queries. By streamlining data retrieval and lowering technical barriers, the system achieves state-of-the-art performance in generating SQL queries for complex tasks. It leverages the BERT (Bidirectional Encoder Representations from Transformers) model for vectorized retrieval, Generative Pretrained Transformer 4 (GPT-4) for query generation, and Graph Neural Networks (GNNs) for modeling database structures. User interaction and feedback mechanisms further refine semantic understanding and query accuracy. Experimental results demonstrate the system's effectiveness. For multitable joins, query matching accuracy using BERT + GPT-4 + GNN reaches 52.3% and 55.1% with beam widths of 1 and 10, respectively. For nested queries involving multitable joins, accuracy increases to 60.2% and 61.9% under the same conditions. Additionally, the system achieves the highest user satisfaction scores, validating its practical utility. By enhancing the ability to handle complex queries and reducing data access barriers, the proposed RAG-based text2SQL system provides enterprise users with an efficient, user-friendly tool for database interaction, significantly improving decision-making processes.</p>\",\"PeriodicalId\":72922,\"journal\":{\"name\":\"Engineering reports : open access\",\"volume\":\"7 6\",\"pages\":\"\"},\"PeriodicalIF\":1.8000,\"publicationDate\":\"2025-06-16\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"https://onlinelibrary.wiley.com/doi/epdf/10.1002/eng2.70249\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Engineering reports : open access\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://onlinelibrary.wiley.com/doi/10.1002/eng2.70249\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Engineering reports : open access","FirstCategoryId":"1085","ListUrlMain":"https://onlinelibrary.wiley.com/doi/10.1002/eng2.70249","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS","Score":null,"Total":0}
引用次数: 0

摘要

现代企业越来越依赖于数据驱动的决策,然而传统的SQL查询需要技术专长,限制了非专业人员的可访问性。自然语言处理的进步,特别是深度学习生成模型,已经实现了文本到sql (text2SQL)的转换,使数据库交互更加直观。检索增强生成(RAG)通过集成检索和生成来提高准确性和相关性,从而增强了这一点。本文提出了一个基于RAG的text2SQL商业智能系统,允许企业用户使用自然语言查询从复杂的数据库中提取见解。通过简化数据检索和降低技术障碍,该系统在为复杂任务生成SQL查询方面达到了最先进的性能。它利用BERT(来自变压器的双向编码器表示)模型进行矢量检索,生成式预训练变压器4 (GPT-4)进行查询生成,以及图神经网络(gnn)进行数据库结构建模。用户交互和反馈机制进一步改进了语义理解和查询准确性。实验结果证明了该系统的有效性。对于多表连接,BERT + GPT-4 + GNN在梁宽为1和10时的查询匹配精度分别达到52.3%和55.1%。对于涉及多表连接的嵌套查询,在相同条件下,准确率分别提高到60.2%和61.9%。此外,该系统获得了最高的用户满意度分数,验证了其实用性。通过增强处理复杂查询和减少数据访问障碍的能力,所提出的基于rag的text2SQL系统为企业用户提供了一种高效、用户友好的数据库交互工具,显著改善了决策过程。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Text2SQL Business Intelligence System Based on Retrieval-Augmented Generation (RAG)

Modern enterprises increasingly depend on data-driven decision-making, yet traditional SQL queries require technical expertise, limiting accessibility for nonspecialists. Advances in natural language processing, particularly deep learning generative models, have enabled text-to-SQL (text2SQL) conversion, making database interaction more intuitive. Retrieval-Augmented Generation (RAG) enhances this by integrating retrieval and generation for greater accuracy and relevance. This article proposes a text2SQL business intelligence system based on RAG, allowing enterprise users to extract insights from complex databases using natural language queries. By streamlining data retrieval and lowering technical barriers, the system achieves state-of-the-art performance in generating SQL queries for complex tasks. It leverages the BERT (Bidirectional Encoder Representations from Transformers) model for vectorized retrieval, Generative Pretrained Transformer 4 (GPT-4) for query generation, and Graph Neural Networks (GNNs) for modeling database structures. User interaction and feedback mechanisms further refine semantic understanding and query accuracy. Experimental results demonstrate the system's effectiveness. For multitable joins, query matching accuracy using BERT + GPT-4 + GNN reaches 52.3% and 55.1% with beam widths of 1 and 10, respectively. For nested queries involving multitable joins, accuracy increases to 60.2% and 61.9% under the same conditions. Additionally, the system achieves the highest user satisfaction scores, validating its practical utility. By enhancing the ability to handle complex queries and reducing data access barriers, the proposed RAG-based text2SQL system provides enterprise users with an efficient, user-friendly tool for database interaction, significantly improving decision-making processes.

求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
CiteScore
5.10
自引率
0.00%
发文量
0
审稿时长
19 weeks
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信