arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2007.06934cs.CLcs.LGcs.SE
收藏

CoreGen:用于提交消息生成的上下文化代码表示学习

CoreGen: Contextualized Code Representation Learning for Commit Message Generation

Harbin Institute of Technology, Shenzhen(哈尔滨工业大学(深圳));The Chinese University of Hong Kong(香港中文大学);Sun Yat-Sen University(中山大学);Nanyang Technological University(南洋理工大学)

Lun Yiu Nie, Cuiyun Gao, Zhicong Zhong, Wai Lam, Yang Liu, Zenglin Xu

摘要:

为代码提交自动生成高质量的提交消息可以大大方便软件开发人员的工作和协调。然而,源代码和自然语言之间的语义鸿沟给这项任务带来了重大挑战。已经提出了一些研究来减轻挑战,但没有明确涉及提交消息生成过程中的代码上下文信息。具体来说,现有的研究采用静态嵌入代码令牌,它将令牌映射到相同的向量,而不管其上下文。在本文中,我们提出了一种新的上下文代码表示学习策略的提交消息生成(CoreGen)。CoreGen首先学习利用代码提交序列背后的上下文信息的上下文化代码表示。在Transformer上构建的代码提交的学习表示然后被微调以用于下游提交消息生成。在基准数据集上的实验表明,我们的模型在BLEU-4评分方面至少提高了28.18%,优于基线模型。此外,我们还强调了未来的机会,在更大的代码语料库作为解决方案,以低资源的任务和适应上下文的代码表示框架,以其他代码到文本生成任务训练上下文的代码表示。

英文摘要:

Automatic generation of high-quality commit messages for code commits can substantially facilitate software developers' works and coordination. However, the semantic gap between source code and natural language poses a major challenge for the task. Several studies have been proposed to alleviate the challenge but none explicitly involves code contextual information during commit message generation. Specifically, existing research adopts static embedding for code tokens, which maps a token to the same vector regardless of its context. In this paper, we propose a novel Contextualized code representation learning strategy for commit message Generation (CoreGen). CoreGen first learns contextualized code representations which exploit the contextual information behind code commit sequences. The learned representations of code commits built upon Transformer are then fine-tuned for downstream commit message generation. Experiments on the benchmark dataset demonstrate the superior effectiveness of our model over the baseline models with at least 28.18% improvement in terms of BLEU-4 score. Furthermore, we also highlight the future opportunities in training contextualized code representations on larger code corpus as a solution to low-resource tasks and adapting the contextualized code representation framework to other code-to-text generation tasks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑