MétaCan
Menu
Back to cohort
Record W3139092713 · doi:10.1109/icpc52881.2021.00049

API2Com: On the Improvement of Automatically Generated Code Comments Using API Documentations

2021· preprint· en· W3139092713 on OpenAlexafffund
Ramin Shahbazi, Rishab Sharma, Fatemeh H. Fard

Bibliographic record

Venuenot available
Typepreprint
Languageen
FieldComputer Science
TopicSoftware Engineering Research
Canadian institutionsUniversity of British Columbia, Okanagan CampusKelowna General HospitalUniversity of British Columbia
FundersNatural Sciences and Engineering Research Council of Canada
KeywordsComputer scienceJavaApplication programming interfaceMachine translationProgramming languageSyntaxCode (set theory)SoftwareSource codeArtificial intelligenceContext (archaeology)TransformerSoftware engineeringData miningMachine learning

Abstract

fetched live from OpenAlex

Code comments can help in program comprehension and are considered as important artifacts to help developers in software maintenance. However, the comments are mostly missing or are outdated, specially in complex software projects. As a result, several automatic comment generation models are developed as a solution. The recent models explore the integration of external knowledge resources such as Unified Modeling Language class diagrams to improve the generated comments. In this paper, we propose API2Com, a model that leverages the Application Programming Interface Documentations (API Docs) as a knowledge resource for comment generation. The API Docs include the description of the methods in more details and therefore, can provide better context in the generated comments. The API Docs are used along with the code snippets and Abstract Syntax Trees in our model.We apply the model on a large Java dataset of over 130,000 methods and evaluate it using both Transformer and RNN- base architectures. Interestingly, when API Docs are used, the performance increase is negligible. We therefore run different experiments to reason about the results. For methods that only contain one API, adding API Docs improves the results by 4% BLEU score on average (BLEU score is an automatic evaluation metric used in machine translation). However, as the number of APIs that are used in a method increases, the performance of the model in generating comments decreases due to long documentations used in the input. Our results confirm that the API Docs can be useful in generating better comments, but, new techniques are required to identify the most informative ones in a method rather than using all documentations simultaneously.

Fetched live from OpenAlex and de-inverted. Abstracts are not stored in this database: the inverted indexes are 8.6 GB of the frame’s 9.3 GB of text, and the host has 13 GB free.

How this classification was reachedexpand

Full frame machine prediction

Teacher imitation

Not calibrated prevalence, not ground truth. Human validation pending. The Gemma side is a direct model label for every work in the frame, read from the title-only record. The Codex side is a classifier learned from the 10,348 direct Codex labels and calibrated to design-weighted sample rates; fields without enough sample support carry no Codex call. Candidate is the union of the two sides; consensus is their intersection. These outputs are machine_predicted_unvalidated and are not human labels.

metaresearch head score (Codex)0.005
metaresearch head score (Gemma)0.023
Version: metacan-v3-hybrid-931329e0061cValidation status: machine_predicted_unvalidated
Candidate categoriesnone
Consensus categoriesnone
DomainCandidate signal: none · Consensus signal: none
Study designCandidate signal: Bench or experimental · Consensus signal: none
GenreCandidate signal: Methods · Consensus signal: Methods
Teacher disagreement score0.025
Threshold uncertainty score0.049

Distilled classifier scores by category (both heads)

CategoryCodexGemma
Metaresearch0.0050.023
Meta-epidemiology (narrow)0.0030.001
Meta-epidemiology (broad)0.0010.001
Bibliometrics0.0050.002
Science and technology studies0.0010.001
Scholarly communication0.0010.003
Open science0.0030.002
Research integrity0.0020.002
Insufficient payload (model declined to judge)0.0030.005

Machine scores (provisional)

The two teacher heads of the student model, read on this work. A score orders the frame for review; it never asserts a category, and the validation status ships verbatim with every row.

Baseline scores from an immature model (maturity gate not passed, 7 training rounds). Scores rank; they never assert a category.

Opus teacher head0.063
GPT teacher head0.338
Teacher spread0.276 · how far apart the two teachers sit on this one work
Validation statusscore_only:v0-immature-baseline · verbatim from the scoring run: score_only means the number may rank works, and no category label ships from it

Classification

machine, unvalidated

Machine predicted; a candidate call from one source (direct Gemma or distilled Codex), not a consensus.

The models applied no category: nothing in the taxonomy fit this work.
Study designBench or experimental
Domainnot available
GenreMethods

How this classification was reached, model by model and score by score, is at the end of the page under "How this classification was reached".

Quick stats

Citations2
Published2021
Admission routes2
Has abstractyes

Explore more

Same topicSoftware Engineering ResearchFrench-language works237,207