A code summarization generation model fusing multi-structure data
Code summarization can help developers understand the function and implementation of the code.The code summarization generation model can automatically identify the key information in the code and generate relevant summarization to improve the readability and maintainability of the code.Ex-isting code summarization generation models usually only use abstract syntax tree structure information to represent code,resulting in low-quality model-generated summarization.Aiming at this problem,this paper proposes a code summarization generation model that integrates multi-structure data.Firstly,the model adds data flow graph structure information to represent code on the basis of abstract syntax tree.Secondly,in order to capture the global information of the code,the model uses Transformer's en-coder to encode the abstract syntax tree sequence.In addition,the model uses the graph neural network to extract features from the data flow graph and provide information such as the computational depen-dencies between variables.Finally,the model uses the cross-modal attention mechanism to fuse the two features of the abstract syntax tree and the data flow and generate corresponding summarization through the Transformer decoder.The experimental results show that,compared with the six mainstream mod-els,the model improves the scores of BLEU,METEOR and ROUGE-L on the Java and Python data-sets,and the generated summarization is also very readable.
code understandingcode summarization generationgraph neural networkmulti-feature fusionnatural language processing