arrow
返回

Summarizing source code with Heterogeneous Syntax Graph and dual position

delete2023-09-01
delete1
PRE
AI
J
Juncai Guo
J
Jin Liu *
刘笑 封面图
刘笑 (Xiao Liu) *
Y
Yao Wan
L
Li Li
DOI:10.1016/j.ipm.2023.103415delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Code summarization attempts to summarize the semantics of source code by automatically producing brief natural-language descriptions. Most existing work proposes to learn from the Abstract Syntax Tree (AST) and plain text of source code for summary generation. However, little attention has been paid to the structural heterogeneity and layout features of source code. In this paper, we present a novel framework titled HETSUm to address these issues. Specifically, a Heterogeneous Syntax Graph (HSG) is first built by designing six types of augmented edges in AST, which indicates the heterogeneous structure of source code. Meanwhile, a dual position is designed for each token in the source code by considering the layout information. Moreover, we develop a heterogeneous graph neural network in HETSUm to encode the HSG while extracting the code layout features with the Transformer encoder. By assimilating the learned code token vectors into the HSG encoder, HETSUm can capture the relations between its two encoders for improved code representation. To facilitate the generation of high-quality summaries, we integrate a copying mechanism into the decoding procedure while expanding the Transformer decoding sublayer. Extensive experiments on the Java and Python datasets prove that HETSUm is superior to seventeen state-of-the-art baselines. To promote reproducibility studies, we make the implementation of HETSUm available at https://github.com/GJCEXP/HETSUM.
Keyword:
Code summarization
Programming language understanding
Graph neural network
Transformer
Heterogeneity

期刊

I
Information Processing and Management
IF:
6.9
论文数:
5.2K
被引数:
1.4W

机构

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收藏
没有更多内容