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

基于扩展Tree-LSTM的Source Code自动摘要

Automatic Source Code Summarization with Extended Tree-LSTM

Kyoto University(京都大学);Hitachi, Ltd.(日立有限公司)

Yusuke Shido, Yasuaki Kobayashi, Akihiro Yamamoto, Atsushi Miyamoto, Tadayuki Matsumura

摘要:

神经机器翻译模型用于从给定源代码自动生成文档,因为这可以被视为机器翻译任务。源代码摘要是自动文档生成的一个组成部分,它从给定的源代码中生成自然语言的摘要。这表明神经机器翻译中使用的技术,如长短期记忆(LSTM),可以用于源代码摘要。然而,在源代码和自然语言之间存在相当大的差异:源代码本质上是{ \em结构}的,具有循环和条件分支等。因此,将已知的机器翻译模型应用于源代码存在一些障碍。抽象语法树(AST)捕捉这些结构特性,并在最近的机器学习研究的源代码中发挥了重要作用。Tree-LSTM是LSTM对树结构数据的推广。然而,在将其应用于AST时存在一个关键问题:它不能同时处理包含具有任意数量的子节点及其顺序的节点的树,而AST通常具有这样的节点。为了解决这个问题,我们提出了Tree-LSTM的扩展,我们称之为\emph{Multi-way Tree-LSTM},并将其应用于源代码摘要。作为计算实验的结果,我们的建议取得了更好的结果时,与几个国家的最先进的技术相比。

英文摘要:

Neural machine translation models are used to automatically generate a document from given source code since this can be regarded as a machine translation task. Source code summarization is one of the components for automatic document generation, which generates a summary in natural language from given source code. This suggests that techniques used in neural machine translation, such as Long Short-Term Memory (LSTM), can be used for source code summarization. However, there is a considerable difference between source code and natural language: Source code is essentially {\em structured}, having loops and conditional branching, etc. Therefore, there is some obstacle to apply known machine translation models to source code. Abstract syntax trees (ASTs) capture these structural properties and play an important role in recent machine learning studies on source code. Tree-LSTM is proposed as a generalization of LSTMs for tree-structured data. However, there is a critical issue when applying it to ASTs: It cannot handle a tree that contains nodes having an arbitrary number of children and their order simultaneously, which ASTs generally have such nodes. To address this issue, we propose an extension of Tree-LSTM, which we call \emph{Multi-way Tree-LSTM} and apply it for source code summarization. As a result of computational experiments, our proposal achieved better results when compared with several state-of-the-art techniques.

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

↑