Treffer: KFCC: A differentiation-aware and keyword-guided fine-grain code comment generation model.
Weitere Informationen
• A new scene of generating fine-grain comments with the help of method-level Comments. • Keyword-Guided Fine-Grain Comment Extractor is applied to generation via gate fusion. • Differentiation-aware enhancing encoder comprehension enhances the model's robustness. • Our proposed model outperforms all benchmarks, whether automated or human evaluation. • All auxiliary modules and all variant strategies contribute to our KFCC model. An efficient and accurate understanding of the intent of code is an indispensable skill in computer technology, especially in collaborative engineering and experimental reproduction. AI-assisted automated code comment generator, with the goal of generating programmer-readable explanations, has been an emerging hot topic for software project comprehension. Despite promising performances, three critical issues emerged: 1) The summary comment is limited in understanding the fine-grain details of the code. 2) key-word level guidance in the model should be included for better comments generation. 3) performance of the generative model may be dampened by noises in the manual annotation. In response, we propose a novel fine-grain comment generation, a scenario of generating the statement-level comment with the assistance of method-level comment. We also propose KFCC, a differentiation-aware and keyword-guided fine-grain comment generation model. Specifically, the proposed KFCC model generates the statement-level comments by incorporating the key information extracted by the keyword extractor in a gate fusion way. To enhance the effectiveness and robustness of the proposed KFCC model, we propose a differentiation-aware enhancing encoder comprehension, letting the model distinguish significant knowledge via contrastive learning. Extensive experiments conducted on open-source projects demonstrate that the KFCC model achieves outstanding performance in six programming languages (including Ruby, Python, JavaScript, Java, etc.) on the CodeSearchNet benchmark. [ABSTRACT FROM AUTHOR]