Abstract: Code summarization aims to convert structured program code into comprehensible natural language descriptions, significantly benefiting software development. The existing approaches mainly employ structure-to-sequence frameworks designed for the Abstract Syntax Tree (AST) format of source code, extensively utilizing architectures such as Tree-based LSTMs, and Graph Neural Networks. From modeling process to encoding architecture can’t effectively learn some of the complex dependencies of the code snippets. In this paper, we propose a Structure-aware Dual Graph Neural Network (SDGNN) for code summarization. Specially, we employ both the grammatical dependency graph and the semantic dependency graph to catch the complex dependency of the program codes in SDGNN. To realize the effective learning of the dual graph, we further devise the hierarchical propagation and the graphical propagation to generate the encoding of the codes, as well as a graph alignment-based dual graph decoder to generate the summarizations from the encoding. Extensive experiments on three programming language datasets show that our framework outperforms state-of-the-art solutions.
External IDs:dblp:journals/mlc/HaoLZXC25
Loading