Multi-Label Classification of Pure Code

Currently, there is a significant amount of public code in the IT communities, programming forums and code repositories. Many of these codes lack classification labels, or have imprecise labels, which causes inconvenience to code management and retrieval. Some classification methods have been propos...

Full description

Bibliographic Details
Published in:International Journal of Software Engineering and Knowledge Engineering
Main Author: Gao B.; Qin H.; Ma X.
Format: Article
Language:English
Published: World Scientific 2024
Online Access:https://www.scopus.com/inward/record.uri?eid=2-s2.0-85200125805&doi=10.1142%2fS0218194024500311&partnerID=40&md5=9dd177c74649f4195ecc855f3db22aff
Description
Summary:Currently, there is a significant amount of public code in the IT communities, programming forums and code repositories. Many of these codes lack classification labels, or have imprecise labels, which causes inconvenience to code management and retrieval. Some classification methods have been proposed to automatically assign labels to the code. However, these methods mainly rely on code comments or surrounding text, and the classification effect is limited by the quality of them. So far, there are a few methods that rely solely on the code itself to assign labels to the code. In this paper, an encoder-only method is proposed to assign multiple labels to the code of an algorithmic problem, in which UniXcoder is employed to encode the input code and the encoding results correspond to the output labels through the classification heads. The proposed method relies only on the code itself. We construct a dataset to evaluate the proposed method, which consists of source code in three programming languages (C++, Java, Python) with a total size of approximately 120K. The results of the comparative experiment show that the proposed method has better performance in multi-label classification task of pure code than encoder-decoder methods. © 2024 World Scientific Publishing Company.
ISSN:2181940
DOI:10.1142/S0218194024500311