IEEE Access (Jan 2019)

Hierarchical Schema Representation for Text-to-SQL Parsing With Decomposing Decoding

  • Meina Song,
  • Zecheng Zhan,
  • Haihong E.

DOI
https://doi.org/10.1109/ACCESS.2019.2931464
Journal volume & issue
Vol. 7
pp. 103706 – 103715

Abstract

Read online

Most of existing studies on parsing natural language (NL) for constructing structured query language (SQL) do not consider the complex structure of database schema and the gap between NL and SQL query. In this paper, we propose a schema-aware neural network with decomposing architecture, namely HSRNet, which aims to address the complex and cross-domain Text-to-SQL generation task. The HSRNet models the relationship of the database schema with a hierarchical schema graph and employs a graph network to encode the information into sentence representation. Instead of end-to-end generation, the HSRNet decomposes the generation process into three phases. Given an input question and schema, we first choose the column candidates and generate the sketch grammar of the SQL query. Then, a detail completion module fills the details based on the column candidates and the corresponding sketch. We demonstrate the effectiveness of our hierarchical schema representation by incorporating the information into different baselines. We further show that the decomposing architecture significantly improves the performance of our model. Evaluation of Spider benchmark shows that the hierarchical schema representation and decomposing architecture improves our parser result by 14.5% and 4.3% respectively.

Keywords