ODIN通过生成多个候选SQL解决数据库字段歧义问题,提升非技术人员查询准确率。
ODIN: A NL2SQL Recommender to Handle Schema Ambiguity
- 基于自然语言生成多组可能的SQL,应对表/列名语义相似导致的歧义。
- 推荐数量随歧义程度动态调整,正确率比基线提升1.5至2倍。
- 可学习用户反馈,持续优化个性化查询建议,适合企业级数据查询场景。
NL2SQL系统将自然语言转换为SQL查询,使无技术背景的用户能与数据库交互并生成报表或可视化。尽管大语言模型(LLMs)显著提升了NL2SQL的准确性,但在复杂企业数据库中,因多个表和列具有语义相似名称而引发的模式歧义仍是主要挑战。为此,我们提出ODIN,一种处理模式歧义的NL2SQL推荐引擎。与仅输出单一SQL不同,ODIN根据对歧义模式组件的不同理解,生成一组潜在的SQL查询。它会根据歧义程度动态调整建议数量,并通过用户反馈学习以个性化未来的查询推荐。评估显示,相比基线方法,ODIN将生成正确SQL的概率提升了1.5至2倍。
原文摘要 · Abstract (English)
NL2SQL (natural language to SQL) systems translate natural language into SQL queries, allowing users with no technical background to interact with databases and create tools like reports or visualizations. While recent advancements in large language models (LLMs) have significantly improved NL2SQL accuracy, schema ambiguity remains a major challenge in enterprise environments with complex schemas, where multiple tables and columns with semantically similar names often co-exist. To address schema ambiguity, we introduce ODIN, a NL2SQL recommendation engine. Instead of producing a single SQL query given a natural language question, ODIN generates a set of potential SQL queries by accounting for different interpretations of ambiguous schema components. ODIN dynamically adjusts the number of suggestions based on the level of ambiguity, and ODIN learns from user feedback to personalize future SQL query recommendations. Our evaluation shows that ODIN improves the likelihood of generating the correct SQL query by 1.5-2$\times$ compared to baselines.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。