Abstract

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 WikiSQL and Spider demonstrate that our approach yields improvements over strong baselines.

Highlights

  • SQL (Structured Query Language) is a vital tool to access databases

  • We propose a relation-aware graph transformer to take into account both the graph structure and various relations embedded in different node pairs

  • We show two examples generated by our model relation-aware graph transformer (RGT) and the transformer with relative position (Figure 5)

Read more

Summary

Introduction

SQL (Structured Query Language) is a vital tool to access databases. SQL is not easy to understand for the average person. SQL program into a natural language description. It can help automatic SQL comment generation as well as build an interactive question answering system [1,2] for natural language interface to a relational database [3,4,5]. It can help people understand complex SQLs quickly by reading corresponding texts

Methods
Results
Conclusion
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call