基于结构和语义的代码分类以及聚类方法  被引量:1

CODE CLASSIFICATION AND CLUSTERING METHOD BASED ON STRUCTURE AND SEMANTIC INFORMATION

在线阅读下载全文

作  者:金岩磊[1] 秦冠军[1] 姜凯 甘迪 史志成 周宇[2] Jin Yanlei;Qin Guanjun;Jiang Kai;Gan Di;Shi Zhicheng;Zhou Yu(NR Electric Co.,Ltd.,Nanjing 211106,Jiangsu,China;College of Computer Science and Technology,Nanjing University of Aeronautics and Astronautics,Nanjing 211106,Jiangsu,China)

机构地区:[1]南京南瑞继保电气有限公司,江苏南京211106 [2]南京航空航天大学计算机科学与技术学院,江苏南京211106

出  处:《计算机应用与软件》2023年第7期1-6,33,共7页Computer Applications and Software

基  金:中央高校基本科研业务费专项资金项目(NS2019055);江苏高校“青蓝工程”项目。

摘  要:提出一个基于抽象语法树(Abstract Syntax Tree,AST)生成代码向量解决代码分类以及聚类任务的深度学习模型,该模型结合了卷积以及循环神经网络能够同时对AST的结构和语义信息进行提取,在代码分类任务上,分类的准确率与该领域最优的模型效果十分接近,速度却是其1.55倍。聚类任务上Jaccard系数(Jaccard Coefficient)、FMI(Fowlkes and Mallows Index)指数、ACC准确率分别达到74.4%、75.2%和83.6%,对比当下前沿的深度学习模型占有优势。This paper proposes a deep learning model through generating code vectors according to abstract syntax tree(AST)to solve code classification and clustering problems.The model combined the convolutional and recurrent neural network to extract the structure and semantic information of AST simultaneously.In terms of code classification tasks,the classification accuracy of the proposed method was very close to that of the state-of-the-art model in the field,but the speed of the proposed method was 1.55 times faster.The Jaccard coefficient(JC),Fowlkes and Mallows index(FMI)and accuracy metrics could be up to 74.4%,75.2%and 83.6%respectively in code clustering task.Compared with current state-of-the-art deep learning models,this model has significant advantages.

关 键 词:抽象语法树 代码理解 代码分类 代码聚类 循环神经网络 卷积神经网络 

分 类 号:TP391[自动化与计算机技术—计算机应用技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象