mlsanityData to 7 Oct 2026

APIContext2Com: Code Comment Generation by Incorporating Pre-Defined API Documentation

arXiv 2303.01645 ↗First posted 3 Mar 2023cs.SE cs.CL cs.LGcited by 2

Not on the map. Why?

Abstract (arXiv)

Code comments are significantly helpful in comprehending software programs and also aid developers to save a great deal of time in software maintenance. Code comment generation aims to automatically predict comments in natural language given a code snippet. Several works investigate the effect of integrating external knowledge on the quality of generated comments. In this study, we propose a solution, namely APIContext2Com, to improve the effectiveness of generated comments by incorporating the pre-defined Application Programming Interface (API) context. The API context includes the definition and description of the pre-defined APIs that are used within the code snippets. As the detailed API information expresses the functionality of a code snippet, it can be helpful in better generating the code summary. We introduce a seq-2-seq encoder-decoder neural network model with different sets of multiple encoders to effectively transform distinct inputs into target comments. A ranking mechanism is also developed to exclude non-informative APIs, so that we can filter out unrelated APIs. We evaluate our approach using the Java dataset from CodeSearchNet. The findings reveal that the proposed model improves the best baseline by 1.88 (8.24 %), 2.16 (17.58 %), 1.38 (18.3 %), 0.73 (14.17 %), 1.58 (14.98 %) and 1.9 (6.92 %) for BLEU1, BLEU2, BLEU3, BLEU4, METEOR, ROUGE-L respectively. Human evaluation and ablation studies confirm the quality of the generated comments and the effect of architecture and ranking APIs.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 31 of its 60 references that are in the map. First posted on arXiv 3 Mar 2023.

Builds on

31 of 60 references.

References · 31

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  4. 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
  5. 2014Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modelingcited by 2,341
  6. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  7. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  8. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  9. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
  10. 2020A Transformer-based Approach for Source Code Summarizationcited by 129
  11. 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
  12. 2016A Convolutional Attention Network for Extreme Summarization of Source Codecited by 90
19 more
  1. 2020Improved Code Summarization via a Graph Neural Networkcited by 79
  2. 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 76
  3. 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
  4. 2019Code Generation as a Dual Task of Code Summarizationcited by 62
  5. 2018Structured Neural Summarizationcited by 53
  6. 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
  7. 2021On the Evaluation of Neural Code Summarizationcited by 47
  8. 2021TreeBERT: A Tree-Based Pre-Trained Model for Programming Languagecited by 40
  9. 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
  10. 2020Improved Automatic Summarization of Subroutines via Attention to File Contextcited by 34
  11. 2019Automatic Source Code Summarization with Extended Tree-LSTMcited by 28
  12. 2021Bridging Pre-trained Models and Downstream Tasks for Source Code Understandingcited by 27
  13. 2021Project-Level Encoding for Neural Source Code Summarization of Subroutinescited by 24
  14. 2019Tree-Transformer: A Transformer-Based Method for Correction of Tree-Structured Datacited by 20
  15. 2022An Exploratory Study on Code Attention in BERTcited by 12
  16. 2021Impact of Evaluation Methodologies on Code Summarizationcited by 11
  17. 2021API2Com: On the Improvement of Automatically Generated Code Comments Using API Documentationscited by 10
  18. 2022On the Effectiveness of Pretrained Models for API Learningcited by 9
  19. 2021Evaluating Pre-Trained Models for User Feedback Analysis in Software Engineering: A Study on Classification of App-Reviewscited by 7

Built on by

Cited by year

Citing papers per year: 2024: 1; 2025: 1.

2 papers.