Transformer-XL With Graph Neural Network for Source Code Summarization
Authors:
- 17 October 2021
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 3436-3441
Abstract
Source code summarization is the task of generating a readable natural language to describe the functionality of source code. Code summarization is rapidly expanding, especially as the research takes great advantage of advances in neural networks and artificial intelligence technologies. Some mainstream methods input the structural information (abstract syntax tree (AST)) of the source code into the language model to generate relatively satisfactory comments. However, existing methods can not capture code’s long dependencies from AST for effective code summarization. In this paper, we provide a novel way to generate code summaries by combining a graph-based neural network and a Transformer-XL network. We utilize the graph-based neural network to better capture the structure information of AST, and the Transformer-XL network to learn important tokens in the AST and alleviate the problem of long dependency. We evaluate our technique on the standard Java dataset. The experimental results show that the effectiveness of our model is remarkable. It pushes the precision score to 60.73% (5.21% absolute improvement) and the F1 score to 51.06%.Keywords
Funding Information
- Ministry of Science and Technology
- National Natural Science Foundation of China
This publication has 22 references indexed in Scilit:
- Improving automatic source code summarization via deep reinforcement learning2018
- Summarizing Source Code with Transferred API Knowledge2018
- Deep code comment generation2018
- A Neural Architecture for Generating Natural Language Descriptions from Source Code Changes2017
- Summarizing Source Code using a Neural Attention Model2016
- Automatic Source Code Summarization of Context for Java MethodsIEEE Transactions on Software Engineering, 2015
- Generating natural language summaries for crosscutting source code concerns2011
- Automatically detecting and describing high level actions within methods2011
- On the Use of Automated Text Summarization Techniques for Summarizing Source Code2010
- Towards automatically generating summary comments for Java methods2010