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

用于Source Code表示学习的模块树网络

Modular Tree Network for Source Code Representation Learning

Wenhan Wang, Ge Li, Sijie Shen, Xin Xia, Zhi Jin

摘要:

源代码的学习表示是许多程序分析任务的基础。近年来,神经网络在这一领域已经取得了成功,但现有的模型大多没有充分利用程序的独特结构信息。虽然基于抽象语法树的神经模型可以处理源代码中的树结构,但它们不能捕获程序中不同类型子结构的丰富性。本文提出了一种模块化树网络(MTN),它根据输入的抽象语法树动态地将不同的神经网络单元组合成树结构。与以往的树结构神经网络模型不同,MTN能够捕捉不同类型AST子结构之间的语义差异。我们评估我们的模型上的两个任务:程序分类和代码克隆检测。在这两个任务中,与最先进的方法相比,我们的模型实现了最好的性能,显示了利用源代码的更精细的结构信息的优势。

英文摘要:

Learning representation for source code is a foundation of many program analysis tasks. In recent years, neural networks have already shown success in this area, but most existing models did not make full use of the unique structural information of programs. Although abstract syntax tree-based neural models can handle the tree structure in the source code, they cannot capture the richness of different types of substructure in programs. In this paper, we propose a modular tree network (MTN) which dynamically composes different neural network units into tree structures based on the input abstract syntax tree. Different from previous tree-structural neural network models, MTN can capture the semantic differences between types of ASTsubstructures. We evaluate our model on two tasks: program classification and code clone detection. Ourmodel achieves the best performance compared with state-of-the-art approaches in both tasks, showing the advantage of leveraging more elaborate structure information of the source code.

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

↑