GuideSQL: Utilizing Tables to Guide the Prediction of Columns for Text-to-SQL Generation

Huajie Wang, Lei Chen, Mei Li, Mengnan Chen · 2020

Text-to-SQL is a task of synthesizing SQL queries from utterances. Most existing approaches of text-to-SQL rarely utilize tables to guide the prediction of SQL query. We present a novel approach called GuideSQL which predicts tables first and uses a pruning algorithm for removing the columns which don't belong to the predicted tables to avoid errors caused by misprediction of table-column dependencies. For reducing the prediction errors of tables, we use the top-K predicted tables to generate SQL queries and employ a string-matching algorithm to get the most reasonable one. Furthermore, a type linking mechanism is utilized to augment the relevance between utterances and schemas. On the challenging text-to-SQL benchmark SParC, we use previous query attention to get context-dependent information of SQL queries. GuideSQL obtains 36.3% question matching accuracy and 19.5% interaction matching accuracy on the dev set. With BERT augmentation, GuideSQL achieves 49.2% question matching accuracy and 31.6% interaction matching accuracy on the dev set, outperforms the previous state-of-the-art model by 2% question matching accuracy and 2.1% interaction matching accuracy.

Read the paper · More papers on PaperTik