Journal of Systems and Software-2022 Automatic source code summarization with graph attention networks

· Journal of Systems and Software· · code-summarization, GNN

Paper: Automatic source code summarization with graph attention networks

Code: https://github.com/sjj0403/GSCS

GSCS: fusing semantic and structural encoders

Abstract

This paper proposes GSCS, which exploits both semantic and structural information of code blocks. Graph attention networks (GAT) operate on the AST with multi-head attention; an RNN is also used to obtain semantic features.

Introduction

Source code has intricate nested structure and cannot be treated as plain text. Existing models also struggle to leverage structural information effectively. For example, structure-based traversal (SBT) introduces many parentheses and unnecessary redundancy; Tree-LSTM and ConvGNN do not account for the context of AST nodes—in other words, each node in an AST has local attributes, but the two approaches above treat them without that distinction (e.g., a+b and b+a are handled equivalently).

The authors argue that GAT can automatically learn and assign weights to neighbors, making it a better choice than Tree-LSTM and ConvGNN.

Approach

avatar
avatar

Evaluation

avataravatar
avatar

<HR align=left color=#987cb9 SIZE=1>