arrow
返回

Code Structure-Guided Transformer for Source Code Summarization

delete2023-02-13
delete33
delete
OA
AI
G
Gao, Shuzheng
C
Cuiyun Gao *
Y
Yulan He
J
Jichuan Zeng
L
Lunyiu Nie
X
Xin Xia
M
Michael R. Lyu
DOI:10.1145/3522674delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Code summaries help developers comprehend programs and reduce their time to infer the program functionalities during software maintenance. Recent efforts resort to deep learning techniques such as sequenceto-sequence models for generating accurate code summaries, among which Transformer-based approaches have achieved promising performance. However, effectively integrating the code structure information into the Transformer is under-explored in this task domain. In this article, we propose a novel approach named SG-Trans to incorporate code structural properties into Transformer. Specifically, we inject the local symbolic information (e.g., code tokens and statements) and global syntactic structure (e.g., dataflow graph) into the self-attention module of Transformer as inductive bias. To further capture the hierarchical characteristics of code, the local information and global structure are designed to distribute in the attention heads of lower layers and high layers of Transformer. Extensive evaluation shows the superior performance of SG-Trans over the state-of-the-art approaches. Compared with the best-performing baseline, SG-Trans still improves 1.4% and 2.0% on two benchmark datasets, respectively, in terms of METEOR score, a metric widely used for measuring generation quality.
Keyword:
Code summary
Transformer
multi-head attention
code structure

期刊

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
论文数:
1.2K
被引数:
3.4K

机构

H
harbin institute of technology
学者数:
8.0W
论文数: 6.6W
被引数: 66
H
huawei technologies
学者数:
3.3K
论文数: 2.9K
被引数: 1
T
tsinghua university
学者数:
11.9W
论文数: 10.0W
被引数: 137
C
Chinese University of Hong Kong
学者数:
3.4W
论文数: 3.2W
被引数: 5.6W
U
University of Warwick
学者数:
2.2W
论文数: 2.2W
被引数: 85
学者 查看更多机构
引用论文

引用论文

err分享
err收藏
Usage and usefulness of technical software documentation: An industrial case study
err2015-01-01
err45
PREAI
errGarousi, Golara; Garousi-Yusifoglu, Vahid; Ruhe, Guenther; Zhi, Junji; Moussavi, Mahmoud; Smith, Brian
err分享
err收藏
Measuring Program Comprehension: A Large-Scale Field Study with Professionals
err2018-10-01
err195
errOAAI
errXia, Xin; Bao, Lingfeng; Lo, David; Xing, Zhenchang; Hassan, Ahmed E.; Li, Shanping
err分享
err收藏
err分享
err收藏
CRaDLe: Deep code retrieval based on semantic Dependency LearningCRaDLe: 基于语义依赖学习的深度代码检索
err2021-09-01
err34
errOAAI
errGu, Wenchao; Li, Zongjie; Gao, Cuiyun; Wang, Chaozheng; Zhang, Hongyu; Xu, Zenglin; Lyu, Michael R.
err分享
err收藏
The Modern Rhytidectomy
err1992-04-01
err0
PREAI
errIvan M. Turpin
err分享
err收藏
没有更多内容