ComFormer: Code Comment Generation via Transformer and Fusion Method-based Hybrid Code Representation

Guang Yang, Xiang Chen, Jinxin Cao, Shuyuan Xu, Zhanqi Cui +2 more
7/8/2021
cs.SE
transformer-attention

Official code: NTDXYG/ComFormer (14 stars, Python, last commit 2022-05-10).

Abstract

Developers often write low-quality code comments due to the lack of programming experience, which can reduce the efficiency of developers program comprehension. Therefore, developers hope that code comment generation tools can be developed to illustrate the functionality and purpose of the code.

Show full abstract

Recently, researchers mainly model this problem as the neural machine translation problem and tend to use deep learning-based methods. In this study, we propose a novel method ComFormer based on Transformer and fusion method-based hybrid code presentation. Moreover, to alleviate OOV (out-of-vocabulary) problem and speed up model training, we further utilize the Byte-BPE algorithm to split identifiers and Sim_SBT method to perform AST Traversal. We compare ComFormer with seven state-of-the-art baselines from code comment generation and neural machine translation domains. Comparison results show the competitiveness of ComFormer in terms of three performance measures. Moreover, we perform a human study to verify that ComFormer can generate high-quality comments.

View on arXivView PDF

Code Implementations(1)

NTDXYG/ComFormerOfficial100%

code and data for paper "ComFormer: Code Comment Generation via Transformer and Fusion Method-based Hybrid Code Representation" accepted in DSA2021

143PythonJul 9, 20214 years ago

Similar Papers

Cite this paper

@article{yang2021comformer,
  title  = {ComFormer: Code Comment Generation via Transformer and Fusion Method-based Hybrid Code Representation},
  author = {Guang Yang and Xiang Chen and Jinxin Cao and Shuyuan Xu and Zhanqi Cui and Chi Yu and Ke Liu},
  year   = {2021},
  eprint = {2107.03644},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2107.03644}
}

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/2107.03644.svg)](https://codeofpaper.com/paper/2107.03644)

Discussion