咨询与建议

看过本文的还看了

相关文献

该作者的其他文献

文献详情 >Context-aware code summarizati... 收藏

Context-aware code summarization with multi-relational graph neural network

作     者:Wang, Yanlin Shi, Ensheng Du, Lun Yang, Xiaodi Hu, Yuxuan Wang, Yanli Guo, Daya Han, Shi Zhang, Hongyu Zhang, Dongmei 

作者机构:Sun Yat Sen Univ Guangzhou Peoples R China Xi An Jiao Tong Univ Xian Peoples R China Microsoft Res Asia Beijing Peoples R China Univ Hong Kong Hong Kong Peoples R China Beijing Univ Technol Beijing Peoples R China Chongqing Univ Chongqing Peoples R China 

出 版 物:《AUTOMATED SOFTWARE ENGINEERING》 (Autom Software Eng)

年 卷 期:2025年第32卷第1期

页      面:1-26页

核心收录:

学科分类:08[工学] 0835[工学-软件工程] 0812[工学-计算机科学与技术(可授工学、理学学位)] 

主  题:Source code summarization Unified modeling language Graph neural network Transformer 

摘      要:Source code summaries are short natural language descriptions of code snippets that help developers better understand and maintain source code. There has been a surge of work on automatic code summarization to reduce the burden of writing summaries manually. However, contemporary approaches only leverage the information within the boundary of the method being summarized (i.e., local context), and ignore the broader context that could assist with code summarization. This paper explores two global contexts, namely intra-class and inter-class contexts, and proposes CoCoSUM: Context-Aware Code Summarization with Multi-Relational Graph Neural Network. CoCoSUM first incorporates class names as the intra-class context to generate the class semantic embeddings. Then, relevant Unified Modeling Language (UML) class diagrams are extracted as inter-class context and are encoded into the class relational embeddings using a novel Multi-Relational Graph Neural Network (MRGNN). Class semantic embeddings and class relational embeddings, together with the outputs from code token encoder and AST encoder, are passed to a decoder armed with a two-level attention mechanism to generate high-quality, context-aware code summaries. Experimental results show that CoCoSUM outperforms state-of-the-art methods and the global contexts adopted in CoCoSUM can also strengthen existing code summarization models. Our replication package is anonymously available at https://***/DeepSoftwareAnalytics/cocosum.

读者评论 与其他读者分享你的观点

用户名:未登录
我的评分