Computer Engineering & Science ›› 2024, Vol. 46 ›› Issue (04): 667-675.
• Software Engineering • Previous Articles Next Articles
YU Tian-ci,GAO Shang
Received:
Revised:
Accepted:
Online:
Published:
Abstract: 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. Existing 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 encoder 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 models, the model improves the scores of BLEU,METEOR and ROUGE-L on the Java and Python datasets, and the generated summarization is also very readable.
Key words: code understanding, code summarization generation, graph neural network, multi-feature fusion, natural language processing
YU Tian-ci, GAO Shang. A code summarization generation model fusing multi-structure data[J]. Computer Engineering & Science, 2024, 46(04): 667-675.
0 / / Recommend
Add to citation manager EndNote|Ris|BibTeX
URL: http://joces.nudt.edu.cn/EN/
http://joces.nudt.edu.cn/EN/Y2024/V46/I04/667