arrow
返回

Summarizing source code through heterogeneous feature fusion and extraction

delete2024-03-01
delete0
PRE
AI
J
Juncai Guo
J
Jin Liu *
刘笑 封面图
刘笑 (Xiao Liu) *
L
Li Li
DOI:10.1016/j.inffus.2023.102058delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Code summarization, which seeks to automatically produce a succinct natural-language description to summarize the functionality of source code, plays an essential role in maintaining the software. Currently, plentiful approaches have been proposed to first encode the source code based on its Abstract Syntax Tree (AST), and then decode it into a textual summary. However, most existing works interpret the AST-based syntax structure as a homogeneous graph, without discriminating the different relations between graph nodes (e.g., the parent-child and sibling relations) in a heterogeneous way. To mitigate this issue, this paper proposes HetCoS to extract the syntactic and sequential features of source code by exploring its inherent heterogeneity for code summarization. Specifically, we first build a Heterogeneous Code Graph (HCG) that fuses the syntax structure and code sequence with eight types of edges/relations designed between graph nodes. Moreover, we present a heterogeneous graph neural network for capturing the diverse relations in HCG. The represented HCG is then fed into a Transformer decoder, followed by a multi-head attention-based copying mechanism to support high-quality summary generation. Extensive experiments on the major Java and Python datasets illustrate the superiority of our approach over sixteen state-of-the-art baselines. To promote reproducibility studies, we make the implementation of HetCoS publicly accessible at https://github.com/GJCEXP/HETCOS.
Keyword:
Code summarization
Feature fusion
Heterogeneous graph
Graph neural network
Transformer

期刊

Information Fusion 封面图
Information Fusion
IF:
15.5
论文数:
4.2K
被引数:
2.7W

机构

B
Beihang University
学者数:
5.2W
论文数: 4.1W
被引数: 37
D
Deakin University
学者数:
2.0W
论文数: 2.1W
被引数: 2.8W
W
wuhan university
学者数:
8.1W
论文数: 5.8W
被引数: 70
学者 查看更多机构
引用论文

引用论文

Automatic source code summarization with graph attention networks
err2022-06-01
err26
errOAAI
errZhou, Yu; Shen, Juanjuan; Zhang, Xiaoqing; Yang, Wenhua; Han, Tingting; Chen, Taolue
err分享
err收藏
Fret: Functional Reinforced Transformer With BERT for Code Summarization
err2020-01-01
err31
errOAAI
errWang, Ruyun; Zhang, Hanwen; Lu, Guoliang; Lyu, Lei; Lyu, Chen
err分享
err收藏
Summarizing source code with hierarchical code representation用分层代码表示总结源代码
err2022-03-01
err14
PREAI
errZhou, Ziyi; Yu, Huiqun; Fan, Guisheng; Huang, Zijie; Yang, Xingguang
err分享
err收藏