TypeSQL: Knowledge-Based Type-Aware Neural Text-to-SQL Generation

Tao Yu, Zifan Li, Zilin Zhang, Rui Zhang, Dragomir Radev


Abstract
Interacting with relational databases through natural language helps users with any background easily query and analyze a vast amount of data. This requires a system that understands users’ questions and converts them to SQL queries automatically. In this paper, we present a novel approach TypeSQL which formats the problem as a slot filling task in a more reasonable way. In addition, TypeSQL utilizes type information to better understand rare entities and numbers in the questions. We experiment this idea on the WikiSQL dataset and outperform the prior art by 6% in much shorter time. We also show that accessing the content of databases can significantly improve the performance when users’ queries are not well-formed. TypeSQL can reach 82.6% accuracy, a 17.5% absolute improvement compared to the previous content-sensitive model.
Anthology ID:
N18-2093
Volume:
Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers)
Month:
June
Year:
2018
Address:
New Orleans, Louisiana
Editors:
Marilyn Walker, Heng Ji, Amanda Stent
Venue:
NAACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
588–594
Language:
URL:
https://aclanthology.org/N18-2093
DOI:
10.18653/v1/N18-2093
Bibkey:
Cite (ACL):
Tao Yu, Zifan Li, Zilin Zhang, Rui Zhang, and Dragomir Radev. 2018. TypeSQL: Knowledge-Based Type-Aware Neural Text-to-SQL Generation. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 588–594, New Orleans, Louisiana. Association for Computational Linguistics.
Cite (Informal):
TypeSQL: Knowledge-Based Type-Aware Neural Text-to-SQL Generation (Yu et al., NAACL 2018)
Copy Citation:
PDF:
https://aclanthology.org/N18-2093.pdf
Code
 taoyds/typesql
Data
WikiSQL