arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.15015cs.SEcs.LG
收藏

利用深度学习对非官方文档进行抽象代码摘要

Leveraging Deep Learning for Abstractive Code Summarization of Unofficial Documentation

Ecole de Technologie Superieure(高等技术学院);Carleton University(卡尔顿大学)

AmirHossein Naghshzan, Latifa Guerrouj, Olga Baysal

AI总结:

本文提出利用 BART 深度学习模型为 StackOverflow 非官方文档中的 API 生成高质量代码摘要,并通过 ROUGE 和 BLEU 评估证明其在精确率、召回率和 F-measure 上分别平均超越此前工作 57%、66% 和 61%,且速度快 4.4 倍。

摘要:

通常,编程语言都有官方文档来指导开发者使用 API、方法和类。然而,研究人员发现文档示例不足或不充分,以及 API 复杂结构带来的缺陷,是学习 API 的障碍。因此,开发者可能会查阅其他来源(如 StackOverflow、GitHub 等)来进一步了解某个 API。近期研究表明,非官方文档是生成代码摘要的宝贵信息来源。因此,我们受到启发,希望利用这类文档并结合深度学习技术,为在非正式文档中讨论的 API 生成高质量摘要。本文提出了一种基于 BART 算法(一种最先进的 transformer 模型)的自动方法,用于为 StackOverflow 中讨论的 API 生成摘要。我们构建了一个由人工生成的摘要作为标准答案(oracle),并使用 ROUGE 和 BLEU 指标(文本摘要领域最广泛使用的评估指标)来评估我们的方法。此外,我们还从质量角度将我们的摘要与此前的一项工作进行了实证比较。研究结果表明,使用深度学习算法可以提高摘要质量,并在精确率上平均超过此前工作 57%,在召回率上超过 66%,在 F-measure 上超过 61%,且运行速度快 4.4 倍。

英文摘要:

Usually, programming languages have official documentation to guide developers with APIs, methods, and classes. However, researchers identified insufficient or inadequate documentation examples and flaws with the API's complex structure as barriers to learning an API. As a result, developers may consult other sources (StackOverflow, GitHub, etc.) to learn more about an API. Recent research studies have shown that unofficial documentation is a valuable source of information for generating code summaries. We, therefore, have been motivated to leverage such a type of documentation along with deep learning techniques towards generating high-quality summaries for APIs discussed in informal documentation. This paper proposes an automatic approach using the BART algorithm, a state-of-the-art transformer model, to generate summaries for APIs discussed in StackOverflow. We built an oracle of human-generated summaries to evaluate our approach against it using ROUGE and BLEU metrics which are the most widely used evaluation metrics in text summarization. Furthermore, we evaluated our summaries empirically against a previous work in terms of quality. Our findings demonstrate that using deep learning algorithms can improve summaries' quality and outperform the previous work by an average of %57 for Precision, %66 for Recall, and %61 for F-measure, and it runs 4.4 times faster.

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

↑