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 条
  • [31] Co-Saliency Detection Based on Multi-Scale Feature Extraction and Feature Fusion
    Zuo, Kuangji
    Liang, Huiqing
    Wang, Dechen
    Zhang, Dehua
    2022 4TH INTERNATIONAL CONFERENCE ON CONTROL AND ROBOTICS, ICCR, 2022, : 364 - 368
  • [32] Binary Code Vulnerability Detection Based on Multi-Level Feature Fusion
    Wu, Guangli
    Tang, Huili
    IEEE ACCESS, 2023, 11 : 63904 - 63915
  • [33] SSD-TSEFFM: New SSD Using Trident Feature and Squeeze and Extraction Feature Fusion
    Hwang, Young-Joon
    Lee, Jin-Gu
    Moon, Un-Chul
    Park, Ho-Hyun
    SENSORS, 2020, 20 (13) : 1 - 14
  • [34] Sparse agent transformer for unified voxel and image feature extraction and fusion
    Zhang, Hong
    Wan, Jiaxu
    He, Ziqi
    Song, Jianbo
    Yang, Yifan
    Yuan, Ding
    INFORMATION FUSION, 2024, 110
  • [35] Online web news extraction via tag path feature fusion
    Wu G.-Q.
    Hu J.
    Li L.
    Xu Z.-H.
    Liu P.-C.
    Hu X.-G.
    Wu X.-D.
    Wu, Xin-Dong (xwu@hfut.edu.cn), 1600, Chinese Academy of Sciences (27): : 714 - 735
  • [36] TFEFusion: Targeted feature extraction model for multimodal medical image fusion
    Fan, Chao
    Xuan, Zhihui
    Peng, Bincheng
    Zhu, Zhentong
    Zhu, Xinru
    BIOMEDICAL SIGNAL PROCESSING AND CONTROL, 2025, 106
  • [37] The effects of fusion-based feature extraction for fabric defect classification
    Ciklacandir, Fatma Gunseli Yasar
    Utku, Semih
    Ozdemir, Hakan
    TEXTILE RESEARCH JOURNAL, 2023, 93 (23-24) : 5448 - 5460
  • [38] Multi-scale Feature Extraction and Fusion for Online Knowledge Distillation
    Zou, Panpan
    Teng, Yinglei
    Niu, Tao
    ARTIFICIAL NEURAL NETWORKS AND MACHINE LEARNING - ICANN 2022, PT IV, 2022, 13532 : 126 - 138
  • [39] Facial Feature Extraction Method Based on Shallow and Deep Fusion CNN
    Liang, Xiaoxi
    Cai, Xiaodong
    Li, Longze
    Chen, Yun
    2017 13TH INTERNATIONAL CONFERENCE ON NATURAL COMPUTATION, FUZZY SYSTEMS AND KNOWLEDGE DISCOVERY (ICNC-FSKD), 2017, : 50 - 53
  • [40] VDHGT: A Source Code Vulnerability Detection Method Based on Heterogeneous Graph Transformer
    Yang, Hongyu
    Yang, Haiyun
    Zhang, Liang
    CYBERSPACE SAFETY AND SECURITY, CSS 2022, 2022, 13547 : 217 - 224