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

基于双边树卷积神经网络的跨语言程序分类学习

Cross-Language Learning for Program Classification using Bilateral Tree-Based Convolutional Neural Networks

Singapore Management University(新加坡管理大学);The Open University, UK(英国开放大学)

Nghi D. Q. Bui, Lingxiao Jiang, Yijun Yu

摘要:

为了将实现算法的代码从一种程序设计语言翻译成另一种编程语言,提出了一种基于双边树的卷积神经网络(BiTBCNN)的程序自动分类方法.它位于两个基于树的卷积神经网络(TBCNN)之上,每个网络都能识别用单独的程序设计语言编写的代码的算法。网络的组合层识别不同程序设计语言的代码之间的相似性和差异。BiTBCNN使用不同语言的源代码进行训练,但已知实现相同的算法和/或功能。为了进行初步评估,我们使用了从GitHub系统抓取的6种算法中的3591个Java和3534个C++代码片段。我们在跨语言二进制分类任务中获得了超过90%的准确率,以判断任何给定的两个代码片段是否实现了相同的算法。此外,对于算法分类任务,即,为了预测六个算法标签中的哪一个是由任意C++代码片段实现的,我们实现了超过80%的精度。

英文摘要:

Towards the vision of translating code that implements an algorithm from one programming language into another, this paper proposes an approach for automated program classification using bilateral tree-based convolutional neural networks (BiTBCNNs). It is layered on top of two tree-based convolutional neural networks (TBCNNs), each of which recognizes the algorithm of code written in an individual programming language. The combination layer of the networks recognizes the similarities and differences among code in different programming languages. The BiTBCNNs are trained using the source code in different languages but known to implement the same algorithms and/or functionalities. For a preliminary evaluation, we use 3591 Java and 3534 C++ code snippets from 6 algorithms we crawled systematically from GitHub. We obtained over 90% accuracy in the cross-language binary classification task to tell whether any given two code snippets implement the same algorithm. Also, for the algorithm classification task, i.e., to predict which one of the six algorithm labels is implemented by an arbitrary C++ code snippet, we achieved over 80% precision.

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

↑