arrow
Return

SeTransformer: A Transformer-Based Code Semantic Parser for Code Comment Generation

delete2023-03-01
delete22
PRE
AI
李征 (Zheng Li)
Y
Yonghao Wu
宾朋 (Bin Peng)
陈翔 cover
陈翔 (Xiang Chen)
Z
Zeyu Sun
Y
Yong Liu *
P
Paul Doyle
DOI:10.1109/TR.2022.3154773delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Automated code comment generation technologies can help developers understand code intent, which can significantly reduce the cost of software maintenance and revision. The latest studies in this field mainly depend on deep neural networks, such as convolutional neural networks and recurrent neural network. However, these methods may not generate high-quality and readable code comments due to the long-term dependence problem, which means that the code blocks used to summarize information are far from each other. Owing to the long-term dependence problem, these methods forget the previous input data's feature information during the training process. In this article, to solve the long-term dependence problem and extract both the text and structure information from the program code, we propose a novel improved-Transformer-based comment generation method, named SeTransformer. Specifically, the SeTransformer utilizes the code tokens and an abstract syntax tree (AST) of programs to extract information as the inputs, and then, it leverages the self-attention mechanism to analyze the text and structural features of code simultaneously. Experimental results based on public corpus gathered from large-scale open-source projects show that our method can significantly outperform five state-of-the-art baselines (such as Hybrid-DeepCom and AST-attendgru). Furthermore, we also conduct a questionnaire survey for developers, and the results show that the SeTransformer can generate higher quality comments than those of other baselines.
Keywords:
Codes
Transformers
Computational modeling
Training
Convolutional neural networks
Feature extraction
Convolution
Code comment generation
convolutional neural network (CNN)
deep learning
program comprehension
Transformer

Journal

IEEE Transactions on Reliability cover
IEEE Transactions on Reliability
IF:
5.7
Papers:
2.7K
Citations:
8.5K

Organization

B
Beijing University of Chemical Technology
Scholars:
3.1W
Papers: 2.2W
Citations: 4.5W
P
peking university
Scholars:
11.7W
Papers: 8.7W
Citations: 146
N
Nantong University
Scholars:
1.9W
Papers: 1.1W
Citations: 2.0W
researcher View more organizations