Summarizing source code through heterogeneous feature fusion and extraction

被引:1
|
作者
Guo, Juncai [1 ]
Liu, Jin [1 ]
Liu, Xiao [2 ]
Li, Li [3 ]
机构
[1] Wuhan Univ, Sch Comp Sci, Wuhan, Peoples R China
[2] Deakin Univ, Sch Informat Technol, Melbourne, Australia
[3] Beihang Univ, Sch Software, Beijing, Peoples R China
基金
中国国家自然科学基金;
关键词
Code summarization; Feature fusion; Heterogeneous graph; Graph neural network; Transformer;
D O I
10.1016/j.inffus.2023.102058
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Code summarization, which seeks to automatically produce a succinct natural-language description to summarize the functionality of source code, plays an essential role in maintaining the software. Currently, plentiful approaches have been proposed to first encode the source code based on its Abstract Syntax Tree (AST), and then decode it into a textual summary. However, most existing works interpret the AST-based syntax structure as a homogeneous graph, without discriminating the different relations between graph nodes (e.g., the parent-child and sibling relations) in a heterogeneous way. To mitigate this issue, this paper proposes HetCoS to extract the syntactic and sequential features of source code by exploring its inherent heterogeneity for code summarization. Specifically, we first build a Heterogeneous Code Graph (HCG) that fuses the syntax structure and code sequence with eight types of edges/relations designed between graph nodes. Moreover, we present a heterogeneous graph neural network for capturing the diverse relations in HCG. The represented HCG is then fed into a Transformer decoder, followed by a multi-head attention-based copying mechanism to support high-quality summary generation. Extensive experiments on the major Java and Python datasets illustrate the superiority of our approach over sixteen state-of-the-art baselines. To promote reproducibility studies, we make the implementation of HetCoS publicly accessible at https://github.com/GJCEXP/HETCOS.
引用
收藏
页数:16
相关论文
共 50 条
  • [41] Heterogeneous Feature Fusion Module Based on CNN and Transformer for Multiview Stereo Reconstruction
    Gao, Rui
    Xu, Jiajia
    Chen, Yipeng
    Cho, Kyungeun
    MATHEMATICS, 2023, 11 (01)
  • [42] A Novel Multiple Kernel Learning Framework for Heterogeneous Feature Fusion and Variable Selection
    Yeh, Yi-Ren
    Lin, Ting-Chu
    Chung, Yung-Yu
    Wang, Yu-Chiang Frank
    IEEE TRANSACTIONS ON MULTIMEDIA, 2012, 14 (03) : 563 - 574
  • [43] Multimodal Emotion Recognition Fusion Analysis Adapting BERT With Heterogeneous Feature Unification
    Lee, Sanghyun
    Han, David K.
    Ko, Hanseok
    IEEE ACCESS, 2021, 9 : 94557 - 94572
  • [44] MPDFF: Multi-source Pedestrian detection based on Feature Fusion
    Meng, Lingxuan
    Zhou, Ji
    Ma, Jin
    Wang, Ziwei
    2022 IEEE INTERNATIONAL GEOSCIENCE AND REMOTE SENSING SYMPOSIUM (IGARSS 2022), 2022, : 7906 - 7909
  • [45] MMF3: Neural Code Summarization Based on Multi-Modal Fine-Grained Feature Fusion
    Ma, Zheng
    Gao, Yuexiu
    Lyu, Lei
    Lyu, Chen
    PROCEEDINGS OF THE16TH ACM/IEEE INTERNATIONAL SYMPOSIUM ON EMPIRICAL SOFTWARE ENGINEERING AND MEASUREMENT, ESEM 2022, 2022, : 171 - 182
  • [46] Deep SpectralSpatial Feature Fusion-Based Multiscale Adaptable Attention Network for Hyperspectral Feature Extraction
    Yu, Wenbo
    Huang, He
    Shen, Gangxiang
    IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, 2023, 72
  • [47] Feature fusion-based malicious code detection with dual attention mechanism and BiLSTM
    Shen, Gaoning
    Chen, Zhixiang
    Wang, Hui
    Chen, Heng
    Wang, Shuqi
    COMPUTERS & SECURITY, 2022, 119
  • [48] Span-based syntactic feature fusion for aspect sentiment triplet extraction
    Xu, Guangtao
    Yang, Zhihao
    Xu, Bo
    Luo, Ling
    Lin, Hongfei
    INFORMATION FUSION, 2025, 120
  • [49] Research on Extraction of Useful Tourism Online Reviews Based on Multimodal Feature Fusion
    Li, Meng
    ACM TRANSACTIONS ON ASIAN AND LOW-RESOURCE LANGUAGE INFORMATION PROCESSING, 2021, 20 (05)
  • [50] A FEATURE FUSION METHOD FOR ROAD LINE EXTRACTION FROM REMOTE SENSING IMAGE
    Huang, Zhijian
    Zhang, Jinfang
    Wang, Luxiao
    2012 IEEE INTERNATIONAL GEOSCIENCE AND REMOTE SENSING SYMPOSIUM (IGARSS), 2012, : 52 - 55