节点文献
基于神经网络融合模型的源代码注释自动生成
A Neural Network Fusion Model for Source Code Comments Generation
【摘要】 注释可以有效提高源代码的可读性、帮助开发者理解软件功能,对于软件的维护和演化起着关键作用.当前源代码注释自动生成方面的研究存在一定局限,一是没有深入挖掘词法信息;二是没能很好的融合词法和语法信息.因此,提出了基于神经网络融合模型的源代码注释自动生成方法,该方法利用编码器-解码器神经网络框架深度表征源代码的词法信息,结合基于语法树挖掘到的语法信息,使用融合机制形成更加全面的功能语义编码向量用于注释自动生成.通过在公开数据集上进行实验,该方法在BLEU4、METEOR等评价指标上均优于对比的模型,验证了方法的有效性.
【Abstract】 The comments are very helpful for understanding the source code and play an important role in software maintenance and evolution. Existing works show that the lack of source code comments is one common practice in real-world projects. Current studies on automatic source code comments generation have two limitations. Firstly,they only use much simple lexical information; secondly,they do not use the lexical and syntactic information well.In this work,we propose a neural network fusion model for source code comments generation based on the encoderdecoder framework. Our model can embed the lexical information better,represent the syntax information based on abstract syntax tree,and then produce a fusion encoder to learn both the lexical and syntactic information for source code comments generation. The experiments on the public benchmark indicate that our fusion model outperforms the previous models by the metrics such as BLEU4 and METEOR.
【Key words】 source code comments; abstract syntax tree; encoder-decoder; fusion model;
- 【文献出处】 空间控制技术与应用 ,Aerospace Control and Application , 编辑部邮箱 ,2021年02期
- 【分类号】TP311.52;TP183
- 【被引频次】2
- 【下载频次】115