跳到主要导航 跳到搜索 跳到主要内容

Scalable Database-Driven KGs can help Text-to-SQL

  • Zhongqiu Li
  • , Zhenhe Wu
  • , Mengxiang Li
  • , Zhongjiang He
  • , Ruiyu Fang
  • , Jie Zhang
  • , Yu Zhao
  • , Yongxiang Li
  • , Zhoujun Li*
  • , Shuangyong Song*
  • *此作品的通讯作者
  • China Telecommunications
  • Beihang University

科研成果: 期刊稿件会议文章同行评审

摘要

The text-to-SQL task aims to covert natural language questions into SQL queries. Large Language Models (LLMs) have demonstrated remarkable performance on this task, which relied on in-context learing or Supervised Fine-Tuning (SFT). However, the heterogeneity of database and the complexity of the knowledge acquisition process pose significant challenges in previous works. To address these, we propose a novel text-to-SQL framework that enhances the performance of LLMs through Knowledge Graphs (KGs). We construct the KGs based on schemas, which are structured representations of the relationships and attributes within the databases. Then, we utilize LLMs to extract descriptions and dependencies from historical queries, which are used to complete contextual knowledge in KGs. We leverage retrieval model to recall benefit nodes and edges from KGs and then employ LLMs to generate task-specific evidence. Based on the evidence and retrieved information, we define a unified KGs-based schema for LLMs to generate SQL queries. Our paper conducts experiments on public datasets BIRD and Spider, and the results indicate that our framework significantly improves the text-to-SQL performance.

源语言英语
期刊CEUR Workshop Proceedings
3828
出版状态已出版 - 2024
活动ISWC 2024 Posters, Demos and Industry Tracks: From Novel Ideas to Industrial Practice, ISWC-Posters-Demos-Industry 2024 - Baltimore, 美国
期限: 11 11月 202415 11月 2024

学术指纹

探究 'Scalable Database-Driven KGs can help Text-to-SQL' 的科研主题。它们共同构成独一无二的学术指纹。

引用此