计算机科学
分类器(UML)
k-最近邻算法
嵌入
数据库事务
人工智能
语义学(计算机科学)
语义特征
特征向量
数据挖掘
特征(语言学)
班级(哲学)
模式识别(心理学)
特征提取
机器学习
数据库
语言学
哲学
程序设计语言
作者
Gang Tian,Guangxin Zhao,Rui Wang,Jiachang Wang,Cheng He
标识
DOI:10.1093/comjnl/bxae070
摘要
Abstract How to quickly and accurately retrieve relevant smart contracts from a huge amount of smart contracts has become an urgent need for users. The classification of smart contracts offers a solution by narrowing down the search space. Existing smart contract classification methods suffer from incomplete semantic feature extraction and a lack of consideration of the existence of rich semantics in existing smart contracts of the same class. To address the above problems, we propose a contrast learning and semantic feature embedding approach to enhance K-Nearest Neighbor (CL-SFE-IKNN). Our method fuses local features, global features, and account transaction features of the smart contract source code to perfect the semantics of the contract. Our method adopts KNN to retrieve multiple instances of contracts in the same class and assigns weights to the model output based on their labels. Meanwhile, we introduce contrastive learning and semantic feature embedding to enhance KNN retrieval to high-quality nearest neighbors of the same class. Experimental results show that by combining a KNN classifier with a traditional linear classifier, our model achieves the best performance compared with other baseline models.
科研通智能强力驱动
Strongly Powered by AbleSci AI