TAG : Type Auxiliary Guiding for Code Comment Generation

Ruichu Cai, Zhihao Liang, Boyan Xu, Zijian Li, Yuexing Hao, Yao Chen


Abstract
Existing leading code comment generation approaches with the structure-to-sequence framework ignores the type information of the interpretation of the code, e.g., operator, string, etc. However, introducing the type information into the existing framework is non-trivial due to the hierarchical dependence among the type information. In order to address the issues above, we propose a Type Auxiliary Guiding encoder-decoder framework for the code comment generation task which considers the source code as an N-ary tree with type information associated with each node. Specifically, our framework is featured with a Type-associated Encoder and a Type-restricted Decoder which enables adaptive summarization of the source code. We further propose a hierarchical reinforcement learning method to resolve the training difficulties of our proposed framework. Extensive evaluations demonstrate the state-of-the-art performance of our framework with both the auto-evaluated metrics and case studies.
Anthology ID:
2020.acl-main.27
Volume:
Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics
Month:
July
Year:
2020
Address:
Online
Editors:
Dan Jurafsky, Joyce Chai, Natalie Schluter, Joel Tetreault
Venue:
ACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
291–301
Language:
URL:
https://aclanthology.org/2020.acl-main.27
DOI:
10.18653/v1/2020.acl-main.27
Bibkey:
Cite (ACL):
Ruichu Cai, Zhihao Liang, Boyan Xu, Zijian Li, Yuexing Hao, and Yao Chen. 2020. TAG : Type Auxiliary Guiding for Code Comment Generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 291–301, Online. Association for Computational Linguistics.
Cite (Informal):
TAG : Type Auxiliary Guiding for Code Comment Generation (Cai et al., ACL 2020)
Copy Citation:
PDF:
https://aclanthology.org/2020.acl-main.27.pdf
Video:
 http://slideslive.com/38929371
Data
CoNaLaWikiSQL