Automatic source code summarization with graph attention networks

被引:17
|
作者
Zhou, Yu [1 ,3 ]
Shen, Juanjuan [1 ]
Zhang, Xiaoqing [1 ]
Yang, Wenhua [1 ,3 ]
Han, Tingting [2 ]
Chen, Taolue [2 ,3 ]
机构
[1] Nanjing Univ Aeronaut & Astronaut, Coll Comp Sci & Technol, Nanjing, Peoples R China
[2] Birkbeck Univ London, Dept Comp Sci, London, England
[3] Nanjing Univ, State Key Lab Novel Software Technol, Nanjing, Peoples R China
基金
中国国家自然科学基金; 英国工程与自然科学研究理事会;
关键词
Source code summarization; Recurrent neural network; Graph neural network; PROGRAM; COMPREHENSION; CONTEXT;
D O I
10.1016/j.jss.2022.111257
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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. (c) 2022 Elsevier Inc. All rights reserved.
引用
收藏
页数:12
相关论文
共 50 条
  • [21] Survey on Neural Network-based Automatic Source Code Summarization Technologies
    Song, Xiao-Tao
    Sun, Hai-Long
    [J]. Ruan Jian Xue Bao/Journal of Software, 2022, 33 (01): : 55 - 77
  • [22] RetCom: Information Retrieval-Enhanced Automatic Source-Code Summarization
    Zhang, Yubo
    Liu, Yanfang
    Fan, Xinxin
    Lu, Yunfeng
    [J]. 2022 IEEE 22ND INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY, QRS, 2022, : 948 - 957
  • [23] Precise Learning of Source Code Contextual Semantics via Hierarchical Dependence Structure and Graph Attention Networks
    Zhao, Zhehao
    Yang, Bo
    Li, Ge
    Liu, Huai
    Jin, Zhi
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2022, 184
  • [24] Precise Learning of Source Code Contextual Semantics via Hierarchical Dependence Structure and Graph Attention Networks
    Zhao, Zhehao
    Yang, Bo
    Li, Ge
    Liu, Huai
    Jin, Zhi
    [J]. JOURNAL OF SYSTEMS AND SOFTWARE, 2022, 184
  • [25] Automatic video summarization by graph modeling
    Ngo, CW
    Ma, YF
    Zhang, HJ
    [J]. NINTH IEEE INTERNATIONAL CONFERENCE ON COMPUTER VISION, VOLS I AND II, PROCEEDINGS, 2003, : 104 - 109
  • [26] Multi-granularity heterogeneous graph attention networks for extractive document summarization
    Zhao, Yu
    Wang, Leilei
    Wang, Cui
    Du, Huaming
    Wei, Shaopeng
    Feng, Huali
    Yu, Zongjian
    Li, Qing
    [J]. NEURAL NETWORKS, 2022, 155 : 340 - 347
  • [27] Towards Modeling Human Attention from Eye Movements for Neural Source Code Summarization
    Bansal, Aakash
    Sharif, Bonita
    McMillan, Collin
    [J]. Proceedings of the ACM on Human-Computer Interaction, 2023, 7 (ETRA)
  • [28] Distilled GPT for source code summarization
    Chia-Yi Su
    Collin McMillan
    [J]. Automated Software Engineering, 2024, 31
  • [29] TASSAL: Autofolding for Source Code Summarization
    Fowkes, Jaroslav
    Chanthirasegaran, Pankajan
    Ranca, Razvan
    Allamanis, Miltiadis
    Lapata, Mirella
    Sutton, Charles
    [J]. 2016 IEEE/ACM 38TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING COMPANION (ICSE-C), 2016, : 649 - 652
  • [30] Recommendations for Datasets for Source Code Summarization
    LeClair, Alex
    McMillan, Collin
    [J]. 2019 CONFERENCE OF THE NORTH AMERICAN CHAPTER OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS: HUMAN LANGUAGE TECHNOLOGIES (NAACL HLT 2019), VOL. 1, 2019, : 3931 - 3937