ComFormer:基于Transformer和Fusion方法的混合代码表示的代码注释生成
ComFormer: Code Comment Generation via Transformer and Fusion Method-based Hybrid Code Representation
摘要:
由于缺乏编程经验,开发人员经常编写低质量的代码注释,这会降低开发人员对程序的理解效率。因此,开发人员希望能够开发代码注释生成工具来说明代码的功能和目的。最近,研究人员主要将此问题建模为神经机器翻译问题,并倾向于使用基于深度学习的方法。在这项研究中,我们提出了一种新的方法ComFormer的基础上Transformer和融合方法为基础的混合代码表示。此外,为了缓解OOV(out-of-vocabulary)问题和加快模型训练,我们进一步使用Byte-BPE算法来分割标识符和Sim_SBT方法来执行AST训练。我们将ComFormer与来自代码注释生成和神经机器翻译域的七个最先进的基线进行比较。比较结果显示了ComFormer在三个性能指标方面的竞争力。此外,我们进行了一项人类研究,以验证ComFormer可以生成高质量的评论。
英文摘要:
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. 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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。