Xu, X, Huang, Q, Wang, Z orcid.org/0000-0001-6157-0662 et al. (2 more authors) (2020) Towards Context-Aware Code Comment Generation. In: Findings of the Association for Computational Linguistics: EMNLP 2020. EMNLP 2020: The 2020 Conference on Empirical Methods in Natural Language Processing, 16-20 Nov 2020, Online. Association for Computational Linguistics , pp. 3938-3947. ISBN 978-1-952148-60-6
Abstract
Code comments are vital for software maintenance and comprehension, but many software projects suffer from the lack of meaningful and up-to-date comments in practice. This paper presents a novel approach to automatically generate code comments at a function level by targeting object-oriented programming languages. Unlike prior work that only uses information locally available within the target function, our approach leverages broader contextual information by considering all other functions of the same class. To propagate and integrate information beyond the scope of the target function, we design a novel learning framework based on the bidirectional gated recurrent unit and a graph attention network with a pointer mechanism. We apply our approach to produce code comments for Java methods and compare it against four strong baseline methods. Experimental results show that our approach outperforms most methods by a large margin and achieves a comparable result with the state-of-the-art method.
Metadata
Item Type: | Proceedings Paper |
---|---|
Authors/Creators: |
|
Copyright, Publisher and Additional Information: | © 2020 Association for Computational Linguistics. This is an open access article under the terms of the Creative Commons Attribution License (CC-BY 4.0). |
Dates: |
|
Institution: | The University of Leeds |
Academic Units: | The University of Leeds > Faculty of Engineering & Physical Sciences (Leeds) > School of Computing (Leeds) |
Depositing User: | Symplectic Publications |
Date Deposited: | 12 Oct 2020 12:47 |
Last Modified: | 05 Feb 2022 23:17 |
Status: | Published |
Publisher: | Association for Computational Linguistics |
Identification Number: | 10.18653/v1/2020.findings-emnlp.350 |
Open Archives Initiative ID (OAI ID): | oai:eprints.whiterose.ac.uk:166542 |