Generate Text-to-SQL Queries Based on Sketch Filling - Yinpei Fu; Songtao Ye; Hongjie Fan (IEEE Access)
The Text-to-SQL task has significant application prospects in automating relational database query interfaces. It can reduce user learning costs and improve data query efficiency. However, in Text-to-SQL tasks, there is often a phenomenon of semantic gaps and insufficient information due to the absence of columns or condition values required by SQL statements explicitly mentioned in the natural language queries. In this paper, a deep learning approach based on sketch filling is proposed to address the issues of insufficient information and semantic gaps in natural language queries. To tackle the problem of insufficient information, the model preprocesses the natural language queries, marks the named entities associated with the database table schema and content, and augments the data by randomly swapping entities. This augmentation strengthens the training of common natural language query templates, improving the model’s accuracy in predicting results for typical questions. To address the issue of semantic gaps, the model introduces the missing table content from the natural language queries during semantic encoding. An attention mechanism is used to enhance the representation of table content, enabling the Text-to-SQL model to better understand queries and improve performance. The results demonstrate that the proposed model achieves better results on two benchmarks. Regarding the content augmentation methods proposed, ablation experiments show that both the data augmentation and table content enhancement schemes can improve the model’s performance.