arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.15686cs.DBcs.CL
收藏

V-SQL:一种基于视图的两阶段文本到SQL框架

V-SQL: A View-based Two-stage Text-to-SQL Framework

Guangzhou Huaweisoft Co. Ltd(广州华软有限公司)

Zeshun You, Jiebin Yao, Dong Cheng, Zhiwei Wen, Zhiliang Lu, Xianyi Shen

AI总结:

本文提出基于视图的模式策略,将紧密耦合的表解耦为低耦合视图,增强LLM对数据库模式的理解,并构建V-SQL两阶段框架,在Bird数据集上取得与最先进方法相当的竞争力。

摘要:

文本到SQL任务旨在将自然语言无偏差地转换为结构化查询语言(SQL)。近年来,基于大型语言模型(LLMs)的文本到SQL方法引起了广泛关注。主流文本到SQL框架的核心是模式链接,它将用户查询与数据库中的相关表和列对齐。以往的方法侧重于模式链接,而忽略了增强LLMs对数据库模式的理解。数据库中表之间复杂的耦合关系限制了LLMs的SQL生成能力。为解决这一问题,本文提出了一种简单而有效的策略,称为基于视图的模式。该策略通过将紧密耦合的表解耦为低耦合的视图,帮助LLMs理解数据库模式。随后,我们引入了V-SQL,一种基于视图的两阶段文本到SQL框架。V-SQL采用基于视图的模式策略来增强LLMs对数据库模式的理解。在权威数据集Bird上的结果表明,与现有最先进的方法相比,V-SQL取得了具有竞争力的性能。

英文摘要:

The text-to-SQL task aims to convert natural language into Structured Query Language (SQL) without bias. Recently, text-to-SQL methods based on large language models (LLMs) have garnered significant attention. The core of mainstream text-to-SQL frameworks is schema linking, which aligns user queries with relevant tables and columns in the database. Previous methods focused on schema linking while neglecting to enhance LLMs' understanding of database schema. The complex coupling relationships between tables in the database constrain the SQL generation capabilities of LLMs. To tackle this issue, this paper proposes a simple yet effective strategy called view-based schema. This strategy aids LLMs in understanding the database schema by decoupling tightly coupled tables into low-coupling views. We then introduce V-SQL, a view-based two-stage text-to-SQL framework. V-SQL involves the view-based schema strategy to enhance LLMs' understanding of database schema. Results on the authoritative datasets Bird indicate that V-SQL achieves competitive performance compared to existing state-of-the-art methods.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑