Chinese Text-to-SQL Parsing Based on Relation-Aware Mechanism
摘要
When converting natural language questions into SQL queries with semantic parsing models, existing methods struggle to parse various unknown database structures. Encoding the relations within the database and aligning the columns in the database with the keywords in given natural language questions are key challenges for existing text-to-SQL methods to achieve generalization. Furthermore, the majority of research related to text-to-SQL tasks is currently based on English datasets, with very limited methods tailored to Chinese questions. To address these challenges, we propose a text-to-SQL method based on relation-aware self-attention mechanism. It utilizes multilingual BERT for initial word embedding and integrates both local and non-local relations distinctively with line graph. Experiments conducted on the Chinese dataset CSpider demonstrate the effectiveness of the proposed method. It achieves an accuracy of 51.9% in exact matching, at least 5% absolute improvement compared to other existing schema encoding and linking text-to-SQL models.