Litcius/Paper detail

Learning Sequential and Structural Information for Source Code Summarization

YunSeok Choi, JinYeong Bak, CheolWon Na, Jee-Hyong Lee

202126 citationsDOIOpen Access PDF

Abstract

We propose a model that learns both the sequential and the structural features of code for source code summarization. We adopt the abstract syntax tree (AST) and graph convolution to model the structural information and the Transformer to model the sequential information. We convert code snippets into ASTs and apply graph convolution to obtain structurally-encoded node representations. Then, the sequences of the graphconvolutioned AST nodes are processed by the Transformer layers. Since structurallyneighboring nodes will have similar representations in graph-convolutioned trees, the Transformer layers can effectively capture not only the sequential information but also the structural information such as sentences or blocks of source code. We show that our model outperforms the state-of-the-art for source code summarization by experiments and human evaluations.

Topics & Concepts

Automatic summarizationComputer scienceSource codeTransformerCode generationGraphProgramming languageTheoretical computer scienceAbstract syntax treeArtificial intelligenceText graphCode (set theory)Natural language processingParsingKey (lock)VoltageSet (abstract data type)Computer securityQuantum mechanicsPhysicsTopic ModelingSoftware Engineering ResearchNatural Language Processing Techniques