Automatic Source Code Summarization with Extended Tree-LSTM

Automatic Source Code Summarization with Extended Tree-LSTM
复制标题

DOI:
10.1109/ijcnn.2019.8851751
复制
发表时间:
2019-06
期刊:
2019 International Joint Conference on Neural Networks (IJCNN)
影响因子:
--
通讯作者:
Yusuke Shido;Yasuaki Kobayashi;Akihiro Yamamoto;A. Miyamoto;Tadayuki Matsumura
Yusuke Shido;Yasuaki Kobayashi;Akihiro Yamamoto;A. Miyamoto;Tadayuki Matsumura
中科院分区:
其他
文献类型:
--
作者:
Yusuke Shido;Yasuaki Kobayashi;Akihiro Yamamoto;A. Miyamoto;Tadayuki Matsumura

文献摘要

被引文献

相似文献

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