Aerospace Contrd and Application ›› 2021, Vol. 47 ›› Issue (2): 42-48.doi: 10.3969/j.issn.1674-1579.2021.02.006

Previous Articles     Next Articles

A Neural Network Fusion Model for Source Code Comments Generation

  

  • Online:2021-04-10 Published:2021-04-19

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 encoderdecoder 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

CLC Number: 

  • TP311