Evaluating Code Comment Generation With Summarized API Docs

被引:0
|
作者
Matmti, Bilel [1 ]
Fard, Fatemeh [1 ]
机构
[1] Univ British Columbia, Dept Comp Sci, Okanagan, BC, Canada
来源
2023 IEEE/ACM 2ND INTERNATIONAL WORKSHOP ON NATURAL LANGUAGE-BASED SOFTWARE ENGINEERING, NLBSE | 2023年
基金
加拿大自然科学与工程研究理事会;
关键词
API Docs; text summarization; comment generation; external knowledge source;
D O I
10.1109/NLBSE59153.2023.00019
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Code comment generation is the task of generating a high-level natural language description for a given code snippet. API2Com is a comment generation model designed to leverage the Application Programming Interface Documentations (API Docs) as an external knowledge resource. Shahbazi et al. [1] showed that API Docs might help increase the model's performance. However, the model's performance in generating pertinent comments deteriorates due to the lengthy documentation used in the input as the number of APIs used in a method increases. In this paper, we propose to evaluate how summarizing the API Docs using an extractive text summarization technique, TextRank, will impact the overall performance of the API2Com. The results of our experiments using the same Java dataset confirm the inverse correlation between the number of APIs and the model's performance. As the number of APIs increases, the performance metrics tend to deteriorate for both configurations of the model, with or without API Docs summarization using TextRank. Experiments also show the impact of the number of APIs on TextRank algorithm capacity to improve the model performance. For example, with 8 APIs, TextRank summarization improved the model BLEU score by 18% on average, but the performance tends to decrease as the number of APIs increases. This demonstrates an open area of research to determine the winning combination in terms of the model configuration and the length of documentation used.
引用
收藏
页码:60 / 63
页数:4
相关论文
共 21 条
  • [1] APIContext2Com: Code Comment Generation by Incorporating Pre-Defined API Documentation
    Shahbazi, Ramin
    Fard, Fatemeh
    2023 IEEE/ACM 31ST INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION, ICPC, 2023, : 13 - 24
  • [2] Deep Code Comment Generation
    Hu, Xing
    Li, Ge
    Xia, Xin
    Lo, David
    Jin, Zhi
    2018 IEEE/ACM 26TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC 2018), 2018, : 200 - 210
  • [3] An alternative to code comment generation? Generating comment from bytecode
    Chen, Xiangping
    Chen, Junqi
    Lian, Zhilu
    Huang, Yuan
    Zhou, Xiaocong
    Wu, Yunzhi
    Zheng, Zibin
    INFORMATION AND SOFTWARE TECHNOLOGY, 2025, 179
  • [4] Deep code comment generation with hybrid lexical and syntactical information
    Hu, Xing
    Li, Ge
    Xia, Xin
    Lo, David
    Jin, Zhi
    EMPIRICAL SOFTWARE ENGINEERING, 2020, 25 (03) : 2179 - 2217
  • [5] CloCom: Mining Existing Source Code for Automatic Comment Generation
    Wong, Edmund
    Liu, Taiyue
    Tan, Lin
    2015 22ND INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER), 2015, : 380 - 389
  • [6] Deep code comment generation with hybrid lexical and syntactical information
    Xing Hu
    Ge Li
    Xin Xia
    David Lo
    Zhi Jin
    Empirical Software Engineering, 2020, 25 : 2179 - 2217
  • [7] Code Comment Generation Based on Concept Propagation for Software Projects
    Pan X.-L.
    Liu C.-X.
    Wang M.
    Zou Y.-Z.
    Wang T.
    Xie B.
    Ruan Jian Xue Bao/Journal of Software, 2023, 34 (09): : 4114 - 4131
  • [8] DeepCommenter: A Deep Code Comment Generation Tool with Hybrid Lexical and Syntactical Information
    Li, Boao
    Yan, Meng
    Xia, Xin
    Hu, Xing
    Li, Ge
    Lo, David
    PROCEEDINGS OF THE 28TH ACM JOINT MEETING ON EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (ESEC/FSE '20), 2020, : 1571 - 1575
  • [9] API2Com: On the Improvement of Automatically Generated Code Comments Using API Documentations
    Shahbazi, Ramin
    Sharma, Rishab
    Fard, Fatemeh H.
    2021 IEEE/ACM 29TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC 2021), 2021, : 411 - 421
  • [10] ALSI-Transformer: Transformer-Based Code Comment Generation With Aligned Lexical and Syntactic Information
    Park, Youngmi
    Park, Ahjeong
    Kim, Chulyun
    IEEE ACCESS, 2023, 11 : 39037 - 39047