DBCopilot: Natural Language Querying over Massive Databases via Schema Routing

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Wang, Tianshu, Chen, Xiaoyang, Lin, Hongyu, Han, Xianpei, Sun, Le, Wang, Hao, Zeng, Zhenyu
Formato: Preprint
Publicado: 2023
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866916625097162752
author Wang, Tianshu
Chen, Xiaoyang
Lin, Hongyu
Han, Xianpei
Sun, Le
Wang, Hao
Zeng, Zhenyu
author_facet Wang, Tianshu
Chen, Xiaoyang
Lin, Hongyu
Han, Xianpei
Sun, Le
Wang, Hao
Zeng, Zhenyu
contents The development of Natural Language Interfaces to Databases (NLIDBs) has been greatly advanced by the advent of large language models (LLMs), which provide an intuitive way to translate natural language (NL) questions into Structured Query Language (SQL) queries. While significant progress has been made in LLM-based NL2SQL, existing approaches face several challenges in real-world scenarios of natural language querying over massive databases. In this paper, we present DBCopilot, a framework that addresses these challenges by employing a compact and flexible copilot model for routing over massive databases. Specifically, DBCopilot decouples schema-agnostic NL2SQL into schema routing and SQL generation. This framework utilizes a single lightweight differentiable search index to construct semantic mappings for massive database schemata, and navigates natural language questions to their target databases and tables in a relation-aware joint retrieval manner. The routed schemata and questions are then fed into LLMs for effective SQL generation. Furthermore, DBCopilot introduces a reverse schema-to-question generation paradigm that can automatically learn and adapt the router over massive databases without manual intervention. Experimental results verify that DBCopilot is a scalable and effective solution for schema-agnostic NL2SQL, providing a significant advance in handling natural language querying over massive databases for NLIDBs.
format Preprint
id arxiv_https___arxiv_org_abs_2312_03463
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle DBCopilot: Natural Language Querying over Massive Databases via Schema Routing
Wang, Tianshu
Chen, Xiaoyang
Lin, Hongyu
Han, Xianpei
Sun, Le
Wang, Hao
Zeng, Zhenyu
Computation and Language
Databases
Information Retrieval
The development of Natural Language Interfaces to Databases (NLIDBs) has been greatly advanced by the advent of large language models (LLMs), which provide an intuitive way to translate natural language (NL) questions into Structured Query Language (SQL) queries. While significant progress has been made in LLM-based NL2SQL, existing approaches face several challenges in real-world scenarios of natural language querying over massive databases. In this paper, we present DBCopilot, a framework that addresses these challenges by employing a compact and flexible copilot model for routing over massive databases. Specifically, DBCopilot decouples schema-agnostic NL2SQL into schema routing and SQL generation. This framework utilizes a single lightweight differentiable search index to construct semantic mappings for massive database schemata, and navigates natural language questions to their target databases and tables in a relation-aware joint retrieval manner. The routed schemata and questions are then fed into LLMs for effective SQL generation. Furthermore, DBCopilot introduces a reverse schema-to-question generation paradigm that can automatically learn and adapt the router over massive databases without manual intervention. Experimental results verify that DBCopilot is a scalable and effective solution for schema-agnostic NL2SQL, providing a significant advance in handling natural language querying over massive databases for NLIDBs.
title DBCopilot: Natural Language Querying over Massive Databases via Schema Routing
topic Computation and Language
Databases
Information Retrieval
url https://arxiv.org/abs/2312.03463