自动为数据库生成描述,提升文本转SQL准确率
Automatic database description generation for Text-to-SQL
- 分两步生成描述:先粗后细,再细回粗,兼顾整体与细节
- 在Bird基准上使SQL准确率提升0.93%,达人类水平的37%
- 适合缺乏人工描述的Text-to-SQL场景,开源代码可复现
在文本转SQL任务中,表和列的描述对弥合自然语言与数据库模式之间的鸿沟至关重要。本文提出一种在无显式描述时自动生成有效数据库描述的方法。该方法采用双阶段流程:先从粗到细,利用大模型内在知识引导理解,从数据库到表再到列,实现结构全局理解与上下文对齐;再从细到粗,从列级出发,回溯至表级,获得更精准的语义刻画。在Bird基准上的实验表明,使用生成的描述使SQL生成准确率提升0.93%,达到人类水平性能的37%。源代码已公开于https://github.com/XGenerationLab/XiYan-DBDescGen。
原文摘要 · Abstract (English)
In the context of the Text-to-SQL task, table and column descriptions are crucial for bridging the gap between natural language and database schema. This report proposes a method for automatically generating effective database descriptions when explicit descriptions are unavailable. The proposed method employs a dual-process approach: a coarse-to-fine process, followed by a fine-to-coarse process. The coarse-to-fine approach leverages the inherent knowledge of LLM to guide the understanding process from databases to tables and finally to columns. This approach provides a holistic understanding of the database structure and ensures contextual alignment. Conversely, the fine-to-coarse approach starts at the column level, offering a more accurate and nuanced understanding when stepping back to the table level. Experimental results on the Bird benchmark indicate that using descriptions generated by the proposed improves SQL generation accuracy by 0.93\% compared to not using descriptions, and achieves 37\% of human-level performance. The source code is publicly available at https://github.com/XGenerationLab/XiYan-DBDescGen.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。