论文标题

学习根据代码更改更新自然语言评论

Learning to Update Natural Language Comments Based on Code Changes

论文作者

Panthaplackel, Sheena, Nie, Pengyu, Gligoric, Milos, Li, Junyi Jessy, Mooney, Raymond J.

论文摘要

我们制定了新的任务,即根据其随附的代码正文的变化自动更新现有的自然语言评论。我们提出了一种方法,该方法学会将两种不同语言表示的变化相关联,以生成应用于现有注释以反映源代码修改的一系列编辑。我们使用从开源软件项目的提交历史记录收集的数据集训练和评估我们的模型,每个示例包括对方法的并发更新及其相应的注释。我们使用自动指标和人类评估将方法与多个基线进行比较。结果反映了这项任务的挑战,并且我们的模型在编辑方面优于基准。

We formulate the novel task of automatically updating an existing natural language comment based on changes in the body of code it accompanies. We propose an approach that learns to correlate changes across two distinct language representations, to generate a sequence of edits that are applied to the existing comment to reflect the source code modifications. We train and evaluate our model using a dataset that we collected from commit histories of open-source software projects, with each example consisting of a concurrent update to a method and its corresponding comment. We compare our approach against multiple baselines using both automatic metrics and human evaluation. Results reflect the challenge of this task and that our model outperforms baselines with respect to making edits.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源