# A Small-Sample Text Classification Model Based on Pseudo-Label Fusion Clustering Algorithm
## 3 Methodology
### Clustering-Based Pseudo-Labeling
#### 3.1.2 Constructing Pseudo-Labeled Datasets  
Text feature clustering is mostly applied in the field of data mining. The principle is through multiple iterations, the points with high similarity are clustered together and divided into a cluster, and high aggregation and low coupling are achieved between clusters, and its class cluster center can be used as the unified feature of this part of similar data, and its characteristics are similar to the category. Thus, we introduce the class cluster center as a pseudo-label. The clustering algorithms are mainly divided into grid-based clustering algorithms, hierarchy-based clustering algorithms, and partitioning-based clustering algorithms [36]. Among them, the grid-based clustering algorithms represented by STING and WAVE-CLUSTER have high execution efficiency, but the accuracy of clustering is low and lacks consideration of the connection between grid cells. The hierarchical-based clustering algorithms represented by algorithms such as BIRCH and Chameleon are fast and use less memory, but the clustering results are strongly influenced by the input order of the objects. In contrast, the partition-based clustering algorithms such as K-means and CLARA are simple and easy to operate and have high accuracy, so the k-means [37] clustering algorithm was finally chosen for the pseudo-label generation.  
The k-means algorithm is a classical clustering algorithm. The principle is that the data samples are divided into clusters according to the distance between data samples, the initial centers are randomly selected according to the given number of centers, the clusters are assigned to the cluster classes with the closest distance in one iteration, and the class cluster centers are dynamically adjusted by calculating the sum of the squares of the differences of the distances between clusters and cluster centers in each cluster class to make the distance between clusters and clusters as large as possible [38] to achieve the sample delineation, the specific process is as follows:  
**Step 1** Obtain the total number of classes from the annotated data text, noted as k-value, and input the dataset samples as clusters.  
**Step 2** Randomly select one cluster from all clusters as the initial center of the cluster class, then select the one farthest from the point as the second initial class cluster center point, then select the point with the largest nearest distance from the first two points as the third initial class cluster center point, and so on until k initial class cluster center points are selected.  
**Step 3** Assigning class clusters to the nearest cluster class set based on the distance between each class cluster and the centroid calculated by Equation (4).  
**Step 4** Recalculating the centroids of each class cluster after calculating the mean value of each cluster with respect to all class cluster centroids by Equation (5).  
**Step 5** When the change in the position of the new class cluster center and the previous class cluster center is less than a threshold, it can be judged that the clustering tends to be stable, indicating that the desired result is reached; if the change in the position of the new class cluster centroid and the previous class cluster center is greater than a threshold, it is necessary to loop the above steps Step 3, Step 4 and Step 5.  
\[d_{c}=\lvert c-c_{i}\rvert_{2}, \tag{4}\]  
\[\text{E}=\sum_{i=1}^{k}\sum_{c\in\text{C}_{i}}\lvert c-\bar{c_{i}}\rvert^{2}, \tag{5}\]  
where \(c\) refers to the value of the samples of the dataset; \(\text{C}_{i}\) is the total representation of a cluster class, \(\bar{c}_{i}\) is the center of class \(\text{C}_{i}\), and \(1\leq i<k\). When the clustering algorithm reaches the specified number of training rounds or the centroids tend to be constant, the \(k\) class cluster centers that are stabilized are the pseudo-labels we need. Then, each unlabeled data point is assigned to the nearest class cluster center to form the pseudo-labeled dataset \(X_{p}\).