Learning to Update Natural Language Comments Based on Code Changes

Sheena Panthaplackel, Pengyu Nie, Milos Gligoric, Junyi Jessy Li, Raymond J. Mooney
4/25/2020
cs.CLcs.LGcs.SE

Official code: panthap2/LearningToUpdateNLComments (33 stars, Python, MIT, last commit 2020-10-24).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT

Learning to Update Natural Language Comments Based on Code Changes: Artifact

338PythonMar 1, 20206 years agoMIT

Similar Papers

Cite this paper

@article{panthaplackel2020learning,
  title  = {Learning to Update Natural Language Comments Based on Code Changes},
  author = {Sheena Panthaplackel and Pengyu Nie and Milos Gligoric and Junyi Jessy Li and Raymond J. Mooney},
  year   = {2020},
  eprint = {2004.12169},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2004.12169}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2004.12169.svg)](https://codeofpaper.com/paper/2004.12169)

Discussion