Automatic Code Annotation Generation Based on Multi-dimensional Heterogeneous Graph Structure

RONG Keyao,XIONG Yun
DOI: https://doi.org/10.19678/j.issn.1000-3428.0064240
2023-01-01
Abstract:The task of automatic code annotation generation has become a research hotspot considering code annotations can enhance the readability of source code and assist the software development process. While some researchers have exploited the sequence information or abstract syntax tree information of source code,the multiple features specific to the code language have not been studied.Therefore,to further exploit the multi-dimensional features of source code and improve the annotation generation effect,this study uses a heterogeneous graph structure and graph neural network to fuse and construct the abstract syntax tree,control flow graph,and data flow graph of the source code into a heterogeneous representation graph with multiple nodes and edges to represent the multi-dimensional features such as semantic features,sequence features,syntax features,and structural features of the code.Furthermore,this study proposes an automatic code annotation generation model based on a multi-dimensional heterogeneous graph structure.The experimental results show that the proposed model can perform better on the real datasets compared to other current models such as Hybrid-DRL,NeuralCodeSum,SeqGNN,et al. The highest improvement in BLEU-4,METEOR,and ROUGE-L metrics are 1.6%,3.2%,and 3.1%,respectively,which obtained more fluent and readable code annotations.
What problem does this paper attempt to address?