Automatic Generation of Comments Based on Code Structure Enhancements

2022 IEEE 5th International Conference on Big Data and Artificial Intelligence (BDAI)(2022)

引用 0|浏览6
暂无评分
摘要
Code comments play a significant role in software maintenance as they can greatly improve the efficiency of software developers' program understanding and reduce maintenance costs. However, due to the bad programming habits of developers and tight project development time, the annotations of many projects are incomplete. Studies have shown that project maintainers spend almost half of their time on understanding programs. Accordingly, this paper proposes a dual-encoder-based deep learning method code structure-enhanced comment generation (CSE-GC) to automatically generate annotation texts for Java methods. CSE-GC uses the CSE traversal method to traverse the abstract syntax tree of the Java method; input the structure information obtained by the traversal and vocabulary information of the source code into the gate recurrent unit encoder and convolutional neural network encoder, respectively; and use the attention mechanism to guide the decoder to generate annotations. This study obtained 131,823 Java methods as the training set data to train the model. The final METEOR value on the test set is 30.95%, and the BLEU-4 value is 45.01%. The results demonstrate that the method proposed in this paper has better performance compared to state-of-the-art models.
更多
查看译文
关键词
code comments,abstract syntax tree,deep learning,attention mechanism,neural machine translation
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要