Modeling Function Relation for Automatic Code Comment GenerationDownload PDF

Anonymous

16 Feb 2022 (modified: 05 May 2023)ACL ARR 2022 February Blind SubmissionReaders: Everyone
Abstract: Comments are essential for software maintenance and comprehension. However, comments are often missing, mismatched or outdated insoftware projects. This paper presents a novel approach to automatically generate descriptive comments for methods and functions. Ourwork targets a practical problem where hand-written comments are only available for a few methods in a source file – a common problemseen in real-world software development. We develop a novel learning framework to model the code relation among methods based on graphneural networks. Our model learns to utilize the partially contextual information extracted from the existing comments to generatemissing comments for all methods in a source file. We evaluate our approach by applying it to Java programs. Experimental results showthat our approach outperforms prior methods by a large margin by generating comments that are judged to be helpful by human evaluatorsand of a higher quality measured by quantified metrics.
Paper Type: long
0 Replies

Loading