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...
Main Authors: | , , , , , |
---|---|
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 |
_version_ | 1797499591544799232 |
---|---|
author | Da Ma Xingyu Chen Ruisheng Cao Zhi Chen Lu Chen Kai Yu |
author_facet | Da Ma Xingyu Chen Ruisheng Cao Zhi Chen Lu Chen Kai Yu |
author_sort | Da Ma |
collection | DOAJ |
description | 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. |
first_indexed | 2024-03-10T03:49:36Z |
format | Article |
id | doaj.art-bafc9709d57a4745bc452933163ddb4d |
institution | Directory Open Access Journal |
issn | 2076-3417 |
language | English |
last_indexed | 2024-03-10T03:49:36Z |
publishDate | 2021-12-01 |
publisher | MDPI AG |
record_format | Article |
series | Applied Sciences |
spelling | doaj.art-bafc9709d57a4745bc452933163ddb4d2023-11-23T11:11:55ZengMDPI AGApplied Sciences2076-34172021-12-0112136910.3390/app12010369Relation-Aware Graph Transformer for SQL-to-Text GenerationDa Ma0Xingyu Chen1Ruisheng Cao2Zhi Chen3Lu Chen4Kai Yu5X-LANCE Lab, MoE Key Lab of Artificial Intelligence, AI Institute, Department of Computer Science and Engineering, Shanghai Jiao Tong University, Shanghai 200240, ChinaX-LANCE Lab, MoE Key Lab of Artificial Intelligence, AI Institute, Department of Computer Science and Engineering, Shanghai Jiao Tong University, Shanghai 200240, ChinaX-LANCE Lab, MoE Key Lab of Artificial Intelligence, AI Institute, Department of Computer Science and Engineering, Shanghai Jiao Tong University, Shanghai 200240, ChinaX-LANCE Lab, MoE Key Lab of Artificial Intelligence, AI Institute, Department of Computer Science and Engineering, Shanghai Jiao Tong University, Shanghai 200240, ChinaX-LANCE Lab, MoE Key Lab of Artificial Intelligence, AI Institute, Department of Computer Science and Engineering, Shanghai Jiao Tong University, Shanghai 200240, ChinaX-LANCE Lab, MoE Key Lab of Artificial Intelligence, AI Institute, Department of Computer Science and Engineering, Shanghai Jiao Tong University, Shanghai 200240, ChinaGenerating 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.https://www.mdpi.com/2076-3417/12/1/369SQL-to-textrelation-aware graph transformer (RGT)abstract SQL syntax tree |
spellingShingle | Da Ma Xingyu Chen Ruisheng Cao Zhi Chen Lu Chen Kai Yu Relation-Aware Graph Transformer for SQL-to-Text Generation Applied Sciences SQL-to-text relation-aware graph transformer (RGT) abstract SQL syntax tree |
title | Relation-Aware Graph Transformer for SQL-to-Text Generation |
title_full | Relation-Aware Graph Transformer for SQL-to-Text Generation |
title_fullStr | Relation-Aware Graph Transformer for SQL-to-Text Generation |
title_full_unstemmed | Relation-Aware Graph Transformer for SQL-to-Text Generation |
title_short | Relation-Aware Graph Transformer for SQL-to-Text Generation |
title_sort | relation aware graph transformer for sql to text generation |
topic | SQL-to-text relation-aware graph transformer (RGT) abstract SQL syntax tree |
url | https://www.mdpi.com/2076-3417/12/1/369 |
work_keys_str_mv | AT dama relationawaregraphtransformerforsqltotextgeneration AT xingyuchen relationawaregraphtransformerforsqltotextgeneration AT ruishengcao relationawaregraphtransformerforsqltotextgeneration AT zhichen relationawaregraphtransformerforsqltotextgeneration AT luchen relationawaregraphtransformerforsqltotextgeneration AT kaiyu relationawaregraphtransformerforsqltotextgeneration |