{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,1,7]],"date-time":"2025-01-07T05:05:03Z","timestamp":1736226303668,"version":"3.32.0"},"reference-count":36,"publisher":"Oxford University Press (OUP)","issue":"11","license":[{"start":{"date-parts":[[2024,7,27]],"date-time":"2024-07-27T00:00:00Z","timestamp":1722038400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/academic.oup.com\/pages\/standard-publication-reuse-rights"}],"funder":[{"name":"National Natural Science Foundation for Young Scholars","award":["61702305"],"award-info":[{"award-number":["61702305"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":[],"published-print":{"date-parts":[[2024,11,20]]},"abstract":"<jats:title>Abstract<\/jats:title>\n               <jats:p>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.<\/jats:p>","DOI":"10.1093\/comjnl\/bxae070","type":"journal-article","created":{"date-parts":[[2024,7,28]],"date-time":"2024-07-28T05:12:50Z","timestamp":1722143570000},"page":"3067-3079","source":"Crossref","is-referenced-by-count":0,"title":["K-Nearest neighbor smart contract classification with semantic feature enhancement"],"prefix":"10.1093","volume":"67","author":[{"given":"Gang","family":"Tian","sequence":"first","affiliation":[{"name":"College of Computer Science and Engineering, Shandong University of Science and Technology , No. 579 Qianwangang Road, Huangdao District, Qingdao, Shandong, 266590,","place":["China"]}]},{"given":"Guangxin","family":"Zhao","sequence":"additional","affiliation":[{"name":"College of Computer Science and Engineering, Shandong University of Science and Technology , No. 579 Qianwangang Road, Huangdao District, Qingdao, Shandong, 266590,","place":["China"]}]},{"given":"Rui","family":"Wang","sequence":"additional","affiliation":[{"name":"College of Energy and Mining Engineerin, Shandong University of Science and Technology , No. 579 Qianwangang Road, Huangdao District, Qingdao, Shandong, 266590,","place":["China"]}]},{"given":"Jiachang","family":"Wang","sequence":"additional","affiliation":[{"name":"College of Computer Science and Engineering, Shandong University of Science and Technology , No. 579 Qianwangang Road, Huangdao District, Qingdao, Shandong, 266590,","place":["China"]}]},{"given":"Cheng","family":"He","sequence":"additional","affiliation":[{"name":"College of Computer Science and Engineering, Shandong University of Science and Technology , No. 579 Qianwangang Road, Huangdao District, Qingdao, Shandong, 266590,","place":["China"]}]}],"member":"286","published-online":{"date-parts":[[2024,7,27]]},"reference":[{"key":"2025010523430129000_ref1","first-page":"64","article-title":"Blockchain revolution: how the technology behind bitcoin is changing money, business, and the world","volume":"25","author":"Radziwill","year":"2018","journal-title":"Qual Manage J"},{"key":"2025010523430129000_ref2","doi-asserted-by":"crossref","first-page":"116","DOI":"10.1080\/13600834.2017.1301036","article-title":"Contract law 2.0:\u2018smart\u2019 contracts as the beginning of the end of classic contract law","volume":"26","author":"Savelyev","year":"2017","journal-title":"Inf Commun Technol Law"},{"key":"2025010523430129000_ref3","first-page":"2452","article-title":"Survey of smart contract technology and application based on blockchain","volume":"55","author":"He","year":"2018","journal-title":"J Comput Res Dev"},{"key":"2025010523430129000_ref4","doi-asserted-by":"crossref","first-page":"1046","DOI":"10.1109\/SANER53432.2022.00122","article-title":"A bytecode-based approach for smart contract classification","volume-title":"2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)","author":"Shi","year":"2022"},{"key":"2025010523430129000_ref5","first-page":"1532","article-title":"Towards automatic smart-contract codes classification by means of word embedding model and transaction information","volume":"43","author":"Huang","year":"2017","journal-title":"Acta Autom Sin"},{"key":"2025010523430129000_ref6","first-page":"1","article-title":"Hierarchical attention mechanism and bidirectional long short-term memory based neural network model for smart contract automatic classification","volume":"1","author":"Wu","year":"2019","journal-title":"J Comput Appl"},{"key":"2025010523430129000_ref7","doi-asserted-by":"crossref","first-page":"43806","DOI":"10.1109\/ACCESS.2020.2977362","article-title":"Smart contract classification with a bi-lstm based approach","volume":"8","author":"Tian","year":"2020","journal-title":"IEEE Access"},{"key":"2025010523430129000_ref8","doi-asserted-by":"crossref","first-page":"50","DOI":"10.15837\/ijccc.2018.1.3142","article-title":"Text classification research with attention-based recurrent neural networks","volume":"13","author":"Du","year":"2018","journal-title":"Int J Comput Commun Control"},{"key":"2025010523430129000_ref9","doi-asserted-by":"crossref","first-page":"2073","DOI":"10.18653\/v1\/P16-1195","article-title":"Summarizing source code using a neural attention model","volume-title":"Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)","author":"Iyer","year":"2016"},{"key":"2025010523430129000_ref10","doi-asserted-by":"crossref","DOI":"10.18653\/v1\/P17-2045","article-title":"A neural architecture for generating natural language descriptions from source code changes","volume-title":"Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)","author":"Loyola","year":"2017"},{"key":"2025010523430129000_ref11","doi-asserted-by":"crossref","first-page":"2179","DOI":"10.1007\/s10664-019-09730-9","article-title":"Deep code comment generation with hybrid lexical and syntactical information","volume":"25","author":"Hu","year":"2020","journal-title":"Empirical Software Eng"},{"key":"2025010523430129000_ref12","first-page":"4370","article-title":"Hierarchy-aware label semantics matching network for hierarchical text classification","volume-title":"Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)","author":"Chen","year":"2021"},{"key":"2025010523430129000_ref13","first-page":"9729","article-title":"Momentum contrast for unsupervised visual representation learning","volume-title":"Proceedings of the IEEE\/CVF conference on computer vision and pattern recognition","author":"He","year":"2020"},{"key":"2025010523430129000_ref14","doi-asserted-by":"crossref","DOI":"10.3115\/v1\/P15-1150","article-title":"Improved semantic representations from tree-structured long short-term memory networks","volume-title":"Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)","author":"Tai"},{"key":"2025010523430129000_ref15","first-page":"1604","article-title":"Long short-term memory over recursive structures","volume-title":"International Conference on Machine Learning","author":"Zhu","year":"2015"},{"key":"2025010523430129000_ref16","doi-asserted-by":"crossref","first-page":"157","DOI":"10.1109\/72.279181","article-title":"Learning long-term dependencies with gradient descent is difficult","volume":"5","author":"Bengio","year":"1994","journal-title":"IEEE Trans. Neural Netw."},{"key":"2025010523430129000_ref17","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1109\/ICPC52881.2021.00010","article-title":"A multi-modal transformer-based code summarization approach for smart contracts","volume-title":"2021 IEEE\/ACM 29th International Conference on Program Comprehension (ICPC)","author":"Yang","year":"2021"},{"key":"2025010523430129000_ref18","doi-asserted-by":"crossref","first-page":"533","DOI":"10.1038\/323533a0","article-title":"Learning representations by back-propagating errors","volume":"323","author":"Rumelhart","year":"1986","journal-title":"Nature"},{"journal-title":"Advances in Neural Information Processing Systems 32","article-title":"Xlnet: generalized autoregressive pretraining for language understanding","author":"Yang","key":"2025010523430129000_ref19"},{"article-title":"Bert: pre-training of deep bidirectional transformers for language understanding","volume-title":"Proceedings of the 2019 Conference of the North {A}merican Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)","author":"Devlin","key":"2025010523430129000_ref20"},{"key":"2025010523430129000_ref21","first-page":"9","article-title":"Language models are unsupervised multitask learners","volume":"1","author":"Radford","year":"2019","journal-title":"OpenAI blog"},{"key":"2025010523430129000_ref22","first-page":"1218","article-title":"A robustly optimized bert pre-training approach with post-training","volume-title":"Proceedings of the 20th Chinese National Conference on Computational Linguistics","author":"Zhuang","year":"2021"},{"key":"2025010523430129000_ref23","article-title":"Albert: A lite bert for self-supervised learning of language representations","volume-title":"International Conference on Learning Representations","author":"Lan","year":"2020"},{"key":"2025010523430129000_ref24","article-title":"Knn-bert: fine-tuning pre-trained models with knn classifier","volume-title":"CoRR","author":"Li","year":"2021"},{"article-title":"Generalization through memorization: nearest neighbor language models","volume-title":"International Conference on Learning Representations","author":"Khandelwal","key":"2025010523430129000_ref25"},{"key":"2025010523430129000_ref26","doi-asserted-by":"crossref","first-page":"3424","DOI":"10.18653\/v1\/2020.findings-emnlp.307","article-title":"Bert-knn: adding a knn search component to pretrained language models for better qa","volume-title":"Findings of the Association for Computational Linguistics: EMNLP 2020","author":"Kassner","year":"2020"},{"key":"2025010523430129000_ref27","first-page":"4008","article-title":"Towards user-driven neural machine translation","volume-title":"Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers)","author":"Lin","year":"2021"},{"key":"2025010523430129000_ref28","first-page":"368","article-title":"Adaptive nearest neighbor machine translation","volume-title":"Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers)","author":"Zheng","year":"2021"},{"key":"2025010523430129000_ref29","doi-asserted-by":"crossref","first-page":"1106","DOI":"10.18653\/v1\/2020.acl-main.104","article-title":"Hierarchy-aware global model for hierarchical text classification","volume-title":"Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics","author":"Zhou","year":"2020"},{"key":"2025010523430129000_ref30","doi-asserted-by":"crossref","first-page":"2935","DOI":"10.18653\/v1\/2020.emnlp-main.235","article-title":"Multi-label few\/zero-shot learning with knowledge aggregated from multiple label graphs","volume-title":"Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)","author":"Lu","year":"2020"},{"key":"2025010523430129000_ref31","doi-asserted-by":"crossref","first-page":"133","DOI":"10.1007\/s10994-008-5064-8","article-title":"Multilabel classification via calibrated label ranking","volume":"73","author":"F\u00fcrnkranz","journal-title":"Machine Learning"},{"key":"2025010523430129000_ref32","first-page":"2820","article-title":"Ranking-based autoencoder for extreme multi-label classification","volume-title":"Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)","author":"Wang","year":"2019"},{"key":"2025010523430129000_ref33","doi-asserted-by":"crossref","first-page":"466","DOI":"10.18653\/v1\/D19-1044","article-title":"Label-specific document representation for multi-label text classification","volume-title":"Proceedings of the 2019 conference on empirical methods in natural language processing and the 9th international joint conference on natural language processing (EMNLP-IJCNLP)","author":"Xiao","year":"2019"},{"key":"2025010523430129000_ref34","doi-asserted-by":"crossref","DOI":"10.1609\/aaai.v31i1.10769","article-title":"Learning deep latent space for multi-label classification","volume-title":"Thirty-first AAAI conference on artificial intelligence","author":"Yeh","year":"2017"},{"key":"2025010523430129000_ref35","doi-asserted-by":"crossref","first-page":"2931","DOI":"10.18653\/v1\/P19-1282","article-title":"Is attention interpretable?","volume-title":"Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics","author":"Serrano","year":"2019"},{"key":"2025010523430129000_ref36","first-page":"770","article-title":"Deep residual learning for image recognition","volume-title":"Proceedings of the IEEE conference on computer vision and pattern recognition","author":"He","year":"2016"}],"container-title":["The Computer Journal"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/academic.oup.com\/comjnl\/article-pdf\/67\/11\/3067\/58663906\/bxae070.pdf","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/academic.oup.com\/comjnl\/article-pdf\/67\/11\/3067\/58663906\/bxae070.pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,1,6]],"date-time":"2025-01-06T04:31:28Z","timestamp":1736137888000},"score":1,"resource":{"primary":{"URL":"https:\/\/academic.oup.com\/comjnl\/article\/67\/11\/3067\/7721728"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,7,27]]},"references-count":36,"journal-issue":{"issue":"11","published-online":{"date-parts":[[2024,7,27]]},"published-print":{"date-parts":[[2024,11,20]]}},"URL":"https:\/\/doi.org\/10.1093\/comjnl\/bxae070","relation":{},"ISSN":["0010-4620","1460-2067"],"issn-type":[{"type":"print","value":"0010-4620"},{"type":"electronic","value":"1460-2067"}],"subject":[],"published-other":{"date-parts":[[2024,11]]},"published":{"date-parts":[[2024,7,27]]}}}