Relation-Aware Graph Transformer for SQL-to-Text Generation

Generating natural language descriptions for structured representation (e.g., a graph) is an important yet challenging task. In this work, we focus on SQL-to-text, a task that maps a SQL query into the corresponding natural language question. Previous work represents SQL as a sparse graph and utiliz...

Full description

Bibliographic Details
Main Authors: Da Ma, Xingyu Chen, Ruisheng Cao, Zhi Chen, Lu Chen, Kai Yu
Format: Article
Language:English
Published: MDPI AG 2021-12-01
Series:Applied Sciences
Subjects:
Online Access:https://www.mdpi.com/2076-3417/12/1/369
Description
Summary:Generating natural language descriptions for structured representation (e.g., a graph) is an important yet challenging task. In this work, we focus on SQL-to-text, a task that maps a SQL query into the corresponding natural language question. Previous work represents SQL as a sparse graph and utilizes a graph-to-sequence model to generate questions, where each node can only communicate with k-hop nodes. Such a model will degenerate when adapted to more complex SQL queries due to the inability to capture long-term and the lack of SQL-specific relations. To tackle this problem, we propose a relation-aware graph transformer (RGT) to consider both the SQL structure and various relations simultaneously. Specifically, an abstract SQL syntax tree is constructed for each SQL to provide the underlying relations. We also customized self-attention and cross-attention strategies to encode the relations in the SQL tree. Experiments on benchmarks <i>WikiSQL</i> and <i>Spider</i> demonstrate that our approach yields improvements over strong baselines.
ISSN:2076-3417