arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1902.01954cs.SE
收藏

生成程序子程序自然语言摘要的神经网络模型

A Neural Model for Generating Natural Language Summaries of Program Subroutines

Alexander LeClair, Siyuan Jiang, Collin McMillan

摘要:

源代码摘要--创建源代码行为的自然语言描述--是一个快速发展的研究课题,它应用于自动文档生成、程序理解和软件维护。传统的技术依赖于人工专家手动构建的算法和模板。最近,基于神经机器翻译的数据驱动方法在很大程度上超过了基于模板的系统。但几乎所有这些技术几乎完全依赖于具有良好内部文档的程序;没有明确的标识符名称,模型无法创建良好的摘要。在本文中,我们提出了一个神经模型,它将代码中的单词与AST中的代码结构相结合。与以前的方法不同,我们的模型将每个数据源作为单独的输入进行处理,这允许模型独立于代码中的文本来学习代码结构。这一过程有助于我们的方法在许多情况下提供连贯的摘要,即使在没有提供内部文件的情况下。我们评估我们的技术,我们从2.1m Java方法创建的数据集。我们发现改进了两个基线技术从SE文献和一个从NLP文献。

英文摘要:

Source code summarization -- creating natural language descriptions of source code behavior -- is a rapidly-growing research topic with applications to automatic documentation generation, program comprehension, and software maintenance. Traditional techniques relied on heuristics and templates built manually by human experts. Recently, data-driven approaches based on neural machine translation have largely overtaken template-based systems. But nearly all of these techniques rely almost entirely on programs having good internal documentation; without clear identifier names, the models fail to create good summaries. In this paper, we present a neural model that combines words from code with code structure from an AST. Unlike previous approaches, our model processes each data source as a separate input, which allows the model to learn code structure independent of the text in code. This process helps our approach provide coherent summaries in many cases even when zero internal documentation is provided. We evaluate our technique with a dataset we created from 2.1m Java methods. We find improvement over two baseline techniques from SE literature and one from NLP literature.

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

↑