arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2004.12169cs.CLcs.LGcs.SE
收藏

基于代码更改学习更新自然语言注释

Learning to Update Natural Language Comments Based on Code Changes

The University of Texas at Austin(德克萨斯大学奥斯汀分校)

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

摘要:

我们制定了新的任务,自动更新现有的自然语言评论的基础上,它伴随着代码的主体的变化。我们提出了一种方法,学习相关的变化在两个不同的语言表示,生成一系列的编辑应用到现有的评论,以反映源代码的修改。我们使用从开源软件项目提交历史中收集的数据集来训练和评估我们的模型,每个示例都由方法及其相应注释的并发更新组成。我们使用自动指标和人工评估将我们的方法与多个基线进行比较。结果反映了这项任务的挑战,我们的模型在编辑方面优于基线。

英文摘要:

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.

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

↑