Litcius/Paper detail

Automatic source code summarization with graph attention networks

Yu Zhou, Juanjuan Shen, Xiaoqing Zhang, Wenhua Yang, Tingting Han, Taolue Chen

2022Journal of Systems and Software38 citationsDOIOpen Access PDF

Abstract

Source code summarization aims to generate concise descriptions for code snippets in a natural language, thereby facilitates program comprehension and software maintenance. In this paper, we propose a novel approach–GSCS–to automatically generate summaries for Java methods, which leverages both semantic and structural information of the code snippets. To this end, GSCS utilizes Graph Attention Networks to process the tokenized abstract syntax tree of the program, which employ a multi-head attention mechanism to learn node features in diverse representation sub-spaces, and aggregate features by assigning different weights to its neighbor nodes. GSCS further harnesses an additional RNN-based sequence model to obtain the semantic features and optimizes the structure by combining its output with a transformed embedding layer. We evaluate our approach on two widely-adopted Java datasets; the experiment results confirm that GSCS outperforms the state-of-the-art baselines.

Topics & Concepts

Computer scienceAutomatic summarizationJavaAbstract syntax treeProgram comprehensionSource codeGraphCode (set theory)SyntaxArtificial intelligenceSoftwareNatural language processingInformation retrievalProgramming languageTheoretical computer scienceSoftware systemSet (abstract data type)Software Engineering ResearchTopic ModelingSoftware System Performance and Reliability
Automatic source code summarization with graph attention networks | Litcius