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.
翻译:开发者往往因为缺乏编程经验而写低质量的代码评论,这可以降低开发者程序理解的效率。 因此, 开发者希望能够开发代码评论生成工具来说明代码的功能和目的。 最近, 研究人员主要将这一问题作为神经机器翻译问题模型, 并倾向于使用深层次的学习方法。 在这次研究中, 我们基于变换器和混合法混合代码演示, 提出了一个新型的ComFormer 方法。 此外, 为了缓解OOOV( 校外)问题并加快模型培训, 我们进一步使用BY- BPE算法来分割识别器和Sim_ SBT 方法来进行 AST Traversal 。 我们从代码评论生成和神经机器翻译域中将ComFormer 与七个最先进的基线进行比较, 比较结果显示ComFormer 在三种性能措施方面的竞争力。 此外, 我们进行了一项人类研究, 以核实ComFormer 能够产生高质量的评论。