arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2306.06347cs.SE
收藏

DocChecker:引导代码大型语言模型检测和解决代码-注释不一致问题

DocChecker: Bootstrapping Code Large Language Model for Detecting and Resolving Code-Comment Inconsistencies

Anh T. V. Dau, Jin L. C. Guo, Nghi D. Q. Bui

AI总结:

本文提出DocChecker,一种基于深度学习的工具,用于检测和纠正代码-注释不一致,并生成合成注释,在ICCD任务上达到72.3%准确率,在代码摘要任务上BLEU-4为33.64,超越GPT 3.5和CodeLlama。

摘要:

源代码中的注释对于开发者理解代码目的并确保其正确使用至关重要。然而,随着代码库的演变,保持注释与代码之间的准确对齐变得越来越具有挑战性。鉴于对自动检测和纠正代码与伴随注释之间差异的解决方案日益增长的兴趣,当前方法主要依赖于启发式规则。相比之下,本文提出了DocChecker,一个由深度学习驱动的工具。DocChecker擅长识别代码与注释之间的不一致性,并且还能生成合成注释。这一能力使该工具能够检测和纠正注释未能准确反映其对应代码段的情况。我们使用Just-In-Time和CodeXGlue数据集在不同设置下展示了DocChecker的有效性。特别是,DocChecker在不一致代码-注释检测(ICCD)任务上取得了72.3%准确率的新最先进结果,在代码摘要任务上相对于其他大型语言模型(LLMs)取得了33.64的BLEU-4分数,甚至超越了GPT 3.5和CodeLlama。DocChecker可供使用和评估。可以在我们的GitHub https://github.com/FSoft-AI4Code/DocChecker 和在线工具 http://4.193.50.237:5000/ 上找到它。为了更全面地了解其功能,YouTube上提供了演示视频 https://youtu.be/FqnPmd531xw。

英文摘要:

Comments within source code are essential for developers to comprehend the code's purpose and ensure its correct usage. However, as codebases evolve, maintaining an accurate alignment between the comments and the code becomes increasingly challenging. Recognizing the growing interest in automated solutions for detecting and correcting differences between code and its accompanying comments, current methods rely primarily on heuristic rules. In contrast, this paper presents DocChecker, a tool powered by deep learning. DocChecker is adept at identifying inconsistencies between code and comments, and it can also generate synthetic comments. This capability enables the tool to detect and correct instances where comments do not accurately reflect their corresponding code segments. We demonstrate the effectiveness of DocChecker using the Just-In-Time and CodeXGlue datasets in different settings. Particularly, DocChecker achieves a new State-of-the-art result of 72.3% accuracy on the Inconsistency Code-Comment Detection (ICCD) task and 33.64 BLEU-4 on the code summarization task against other Large Language Models (LLMs), even surpassing GPT 3.5 and CodeLlama. DocChecker is accessible for use and evaluation. It can be found on our GitHub https://github.com/FSoft-AI4Code/DocChecker and as an Online Tool http://4.193.50.237:5000/. For a more comprehensive understanding of its functionality, a demonstration video is available on YouTube https://youtu.be/FqnPmd531xw.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑