Pyramid Attention For Source Code Summarization

被引:0
|
作者
Chai, Lei [1 ]
Li, Ming [1 ]
机构
[1] Nanjing Univ, Natl Key Lab Novel Software Technol, Nanjing 210023, Peoples R China
关键词
D O I
暂无
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
This paper presents a multi-granularity method for source code summarization, which generates a concise functional description for the given code snippet. We notice that skilled programmers write and read source codes hierarchically and pay close attention to conceptual entities like statements, tokens, sub-tokens, and the mapping relations between them. The entities have specific emphasis according to their granularities, e.g., statements in coarse-granularity reveal the global logical semantics of code, and the sub-tokens in fine-granularity are more related to the textual semantics. Driven by this observation, we demonstrate that a multi-granularity formulation incorporating these conceptual entities benefit the code summarization task. Concretely, the source code is transformed into a pyramidal representation, and then a pyramid attention mechanism is applied for efficient feature aggregation among different hierarchies in it. We instantiate our multi-granularity method using the proposed pyramid attention and name it PA-former (Pyramid Attention transformer). We evaluated it on two source code summarization benchmarks where it surpasses the prior works and achieves new state-of-the-art results. Our code and data are available at https://github.com/leichainju/pa-former.
引用
收藏
页数:13
相关论文
共 50 条
  • [21] An data augmentation method for source code summarization
    Song, Zixuan
    Zeng, Hui
    Shang, Xiuwei
    Li, Guanxi
    Li, Hui
    Guo, Shikai
    [J]. NEUROCOMPUTING, 2023, 549
  • [22] Supporting software documentation with source code summarization
    Al-Msie'deen, Ra'Fat
    Blasi, Anas H.
    [J]. INTERNATIONAL JOURNAL OF ADVANCED AND APPLIED SCIENCES, 2019, 6 (01): : 59 - 67
  • [23] TraceLab Components for Reproducing Source Code Summarization Experiments
    Cruz, Breno Dantas
    McBurney, Paul W.
    McMillan, Collin
    [J]. 32ND IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2016), 2016, : 610 - 610
  • [24] An Extractive-and-Abstractive Framework for Source Code Summarization
    Sun, Weisong
    Fang, Chunrong
    Chen, Yuchen
    Zhang, Quanjun
    Tao, Guanhong
    You, Yudu
    Han, Tingxu
    Ge, Yifei
    Hu, Yuling
    Luo, Bin
    Chen, Zhenyu
    [J]. ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2024, 33 (03)
  • [25] Semantic similarity loss for neural source code summarization
    Su, Chia-Yi
    McMillan, Collin
    [J]. JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2024,
  • [26] Learning Sequential and Structural Information for Source Code Summarization
    Choi, YunSeok
    Bak, JinYeong
    Na, CheolWon
    Lee, Jee-Hyong
    [J]. FINDINGS OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS, ACL-IJCNLP 2021, 2021, : 2842 - 2851
  • [27] Ensemble Models for Neural Source Code Summarization of Subroutines
    LeClair, Alexander
    Bansal, Aakash
    McMillan, Collin
    [J]. 2021 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2021), 2021, : 286 - 297
  • [28] Naturalness in Source Code Summarization. How Significant is it?
    Ferretti, Claudio
    Saletta, Martina
    [J]. 2023 IEEE/ACM 31ST INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION, ICPC, 2023, : 125 - 134
  • [29] Automatic Documentation Generation via Source Code Summarization
    McBurney, Paul W.
    [J]. 2015 IEEE/ACM 37TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, VOL 2, 2015, : 903 - 906
  • [30] Action Word Prediction for Neural Source Code Summarization
    Haque, Sakib
    Bansal, Aakash
    Wu, Lingfei
    McMillan, Collin
    [J]. 2021 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER 2021), 2021, : 330 - 341