arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1708.01837cs.SE
收藏

CodeSum:将程序语言翻译为自然语言

CodeSum: Translate Program Language to Natural Language

Xing Hu, Yuhan Wei, Ge Li, Zhi Jin

摘要:

在软件维护过程中,程序员花费大量时间在代码理解上。阅读注释是程序员在理解源代码时减少阅读和导航时间的有效方法。因此,作为软件工程中的一项重要任务,代码摘要旨在为源代码生成简短的自然语言描述。本文提出了一种新的代码摘要模型CodeSum。CodeSum利用基于注意力的序列到序列(Seq2Seq)神经网络和抽象树(AST)的基于结构的训练(SBT)。SBT生成的AST序列能更好地呈现AST的结构,且保持了序列的无歧义性。我们在三个不同语言的大规模语料库上进行了实验,Java,C#和SQL,其中Java语料库是我们从Github中提取的新提议的行业代码。实验结果表明,我们的方法CodeSum优于国家的最先进的显着。

英文摘要:

During software maintenance, programmers spend a lot of time on code comprehension. Reading comments is an effective way for programmers to reduce the reading and navigating time when comprehending source code. Therefore, as a critical task in software engineering, code summarization aims to generate brief natural language descriptions for source code. In this paper, we propose a new code summarization model named CodeSum. CodeSum exploits the attention-based sequence-to-sequence (Seq2Seq) neural network with Structure-based Traversal (SBT) of Abstract Syntax Trees (AST). The AST sequences generated by SBT can better present the structure of ASTs and keep unambiguous. We conduct experiments on three large-scale corpora in different program languages, i.e., Java, C#, and SQL, in which Java corpus is our new proposed industry code extracted from Github. Experimental results show that our method CodeSum outperforms the state-of-the-art significantly.

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

↑