arrow
返回

Esale: Enhancing Code-Summary Alignment Learning for Source Code Summarization

delete2024-08-01
delete2
PRE
AI
房
房春荣 (Chunrong Fang)
W
Weisong Sun *
Y
Yuchen Chen
陈
陈骁 (Xiao Chen)
Z
Zhao Wei
Q
Quanjun Zhang
Y
Yudu You
B
Bin Luo
刘
刘洋 (Yang Liu)
陈
陈振宇 (Zhenyu Chen)
DOI:10.1109/TSE.2024.3422274delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
(Source) code summarization aims to automatically generate succinct natural language summaries for given code snippets. Such summaries play a significant role in promoting developers to understand and maintain code. Inspired by neural machine translation, deep learning-based code summarization techniques widely adopt an encoder-decoder framework, where the encoder transforms given code snippets into context vectors, and the decoder decodes context vectors into summaries. Recently, large-scale pre-trained models for source code (e.g., CodeBERT and UniXcoder) are equipped with encoders capable of producing general context vectors and have achieved substantial improvements on the code summarization task. However, although they are usually trained mainly on code-focused tasks and can capture general code features, they still fall short in capturing specific features that need to be summarized. In a nutshell, they fail to learn the alignment between code snippets and summaries (code-summary alignment for short). In this paper, we propose a novel approach to improve code summarization based on summary-focused tasks. Specifically, we exploit a multi-task learning paradigm to train the encoder on three summary-focused tasks to enhance its ability to learn code-summary alignment, including unidirectional language modeling (ULM), masked language modeling (MLM), and action word prediction (AWP). Unlike pre-trained models that mainly predict masked tokens in code snippets, we design ULM and MLM to predict masked words in summaries. Intuitively, predicting words based on given code snippets would help learn the code-summary alignment. In addition, existing work shows that AWP affects the prediction of the entire summary. Therefore, we further introduce the domain-specific task AWP to enhance the ability of the encoder to learn the alignment between action words and code snippets. We evaluate the effectiveness of our approach, called Esale, by conducting extensive experiments on four datasets, including two widely used datasets JCSD and PCSD, a cross-project Java dataset CPJD, and a multilingual language dataset CodeSearchNet. Experimental results show that Esale significantly outperforms state-of-the-art baselines in all three widely used metrics, including BLEU, METEOR, and ROUGE-L. Moreover, the human evaluation proves that the summaries generated by Esale are more informative and closer to the ground-truth summaries.
Keyword:
Source code summarization
deep learning
multi-task learning
Source code summarization
deep learning
multi-task learning

期刊

IEEE Transactions on Software Engineering 封面图
IEEE Transactions on Software Engineering
IF:
5.6
论文数:
2.9K
被引数:
1.1W

机构

N
Nanyang Technological University
学者数:
4.9W
论文数: 4.8W
被引数: 8.1W
T
Tencent
学者数:
1.1K
论文数: 898
被引数: 5
N
nanjing university
学者数:
7.8W
论文数: 5.6W
被引数: 87
学者 查看更多机构
引用论文

引用论文

Clinical outcome of Taiwanese men with clinically localized prostate cancer post-radical prostatectomy: a comparison with other ethnic groups
err2009-11-03
err0
PREAI
errShu-pin Huang; Chao-Yuan Huang; Chia-Chu Liu; Chia-Cheng Yu; Yeong-Shiau Pu; Shih-Chieh Chueh; Hong-Jeng Yu; Tony T. Wu; Ching-Chia Li; Chun-Hsiung Huang; Wen-Jeng Wu
err分享
err收藏
err
IF0
err
err0
errOAAI
err
err分享
err收藏
err分享
err收藏
Study on Oxygen Control of Large Diameter N-type Monocrystalline Silicon with Large Thermal Field
err2023-10-19
err0
PREAI
errYang Yang; Huimin Li; Zechen Hu; Jinwei Guo; Xiangyu Li; Peidong Liu; Xuegong Yu
err分享
err收藏
Innovative pulmonary preservation of non-heart-beating donor grafts in experimental lung transplantation1
err2004-07-01
err0
errOAAI
errT WITTWER; U FRANKE; A FEHRENBACH; M OCHS; T SANDHAUS; N DREYER; J RICHTER; T WAHLERS
err分享
err收藏
Ninety-six suspected transfusion related acute lung injury cases: Investigation findings and clinical outcome
err2013-09-04
err0
errOAAI
errNay Win; Edwin Massey; Geoff Lucas; Deborah Sage; Colin Brown; Ann Green; Marcela Contreras; Cristina Navarrete
err分享
err收藏
Homeobox Gene Involvement in Normal Hematopoiesis and in the Pathogenesis of Childhood Leukemias
err2017-01-01
err0
PREAI
errMaria Adamaki; Maria Goulielmaki; Ioannis Christodoulou; Spiros Vlahopoulos; Vassilis Zoumpourlis
err分享
err收藏
err
IF0
err
err0
PREAI
err
err分享
err收藏
学者 查看更多内容