中文标题#
AmbiSQL:文本到 SQL 的交互式歧义检测与解决
英文标题#
AmbiSQL: Interactive Ambiguity Detection and Resolution for Text-to-SQL
中文摘要#
文本到 SQL 系统將自然語言問題轉換為 SQL 查詢,為非專家用戶提供重要價值。 雖然大型語言模型(LLMs)在此任務中表現出有希望的結果,但它們仍然容易出錯。 查詢歧義已被認為是基於 LLM 的文本到 SQL 系統的主要障礙,導致用戶意圖的誤解和不準確的 SQL 生成。 我們展示了 AmbiSQL,一個交互式系統,能夠自動檢測查詢歧義,並通過直觀的多選問題引導用戶澄清其意圖。 我們的方法引入了一個細粒度的歧義分類法,用於識別影響數據庫元素映射和 LLM 推理的歧義,然後結合用戶反饋重寫模糊問題。 在模糊查詢數據集上的評估表明,AmbiSQL 在歧義檢測中的精度達到 87.2%,當與文本到 SQL 系統集成時,SQL 精確匹配準確率提高了 50%。 我們的演示展示了顯著的性能提升,並突出了系統的實用性。 代碼倉庫和演示可在以下地址獲取:https://github.com/JustinzjDing/AmbiSQL.
英文摘要#
Text-to-SQL systems translate natural language questions into SQL queries, providing substantial value for non-expert users. While large language models (LLMs) show promising results for this task, they remain error-prone. Query ambiguity has been recognized as a major obstacle for LLM-based Text-to-SQL systems, leading to misinterpretation of user intent and inaccurate SQL generation. We demonstrate AmbiSQL, an interactive system that automatically detects query ambiguities and guides users through intuitive multiple-choice questions to clarify their intent. Our approach introduces a fine-grained ambiguity taxonomy for identifying ambiguities that affect database element mapping and LLM reasoning, then incorporates user feedback to rewrite ambiguous questions. Evaluation on an ambiguous query dataset shows that AmbiSQL achieves 87.2% precision in ambiguity detection and improves SQL exact match accuracy by 50% when integrated with Text-to-SQL systems. Our demonstration showcases the significant performance gains and highlights the system's practical usability. Code repo and demonstration are available at: https://github.com/JustinzjDing/AmbiSQL.
文章页面#
PDF 获取#
抖音扫码查看更多精彩内容