Abstract
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.
| Original language | English |
|---|---|
| Journal | CEUR Workshop Proceedings |
| Volume | 3828 |
| State | Published - 2024 |
| Event | ISWC 2024 Posters, Demos and Industry Tracks: From Novel Ideas to Industrial Practice, ISWC-Posters-Demos-Industry 2024 co-located with 23nd International Semantic Web Conference, ISWC 2024 - Baltimore, United States Duration: 11 Nov 2024 → 15 Nov 2024 |
Keywords
- Knowledge Generation
- Knowledge Graph
- Large Language Models
- Text-to-SQL
Fingerprint
Dive into the research topics of 'Scalable Database-Driven KGs can help Text-to-SQL'. Together they form a unique fingerprint.Cite this
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver