# A Chinese Few-Shot Text Classification Method Utilizing Improved Prompt Learning and Unlabeled Data
## 3 Chinese Few-Shot Text Classification Method with Improved Prompt Learning and Unlabeled Data
### One-Class Support Vector Machine-based Unlabeled Data Leveraging Module  
Numerous studies have demonstrated that utilizing unlabeled data can effectively enhance the few-shot text classification [37]. Previous methods utilized trained models to provide pseudo-labels to unlabeled data, and high thresholds were used to avoid noisy data. However, this approach was time-consuming, and there was a risk of model overconfidence. Inspired by anomaly detection [38; 39], we consider the potential overconfidence in unlabeled data as an anomalous phenomenon. To solve this problem, we use the One-Class Support Vector Machine (OCSVM) algorithm to create multiple spherical constraint boundaries for existing samples with different labels. These constraint boundaries are used to filter out anomalous unlabeled data and assign appropriate pseudo-labels. The spherical shape boundary is superior for text classification [40]. As shown in Figure 2, we have developed an OCSVM-based unlabeled data utilization module (OCSVM-DL). The OCSVM algorithm is designed specifically for one-class classification, and it only needs to be trained on data from a single class. Unlike the standard SVM algorithm, which aims to construct a generalized optimal classification plane that maximizes the margin between the two classes, the OCSVM seeks to find a hyper-sphere in the featu  
Figure 2: The strategy of adding unlabeled data and performing iterative training is implemented through the One-Class Support Vector Machine-based Unlabeled Data Leveraging module. the data and has the smallest possible volume, maximizing the margin between the inlier data and the outliers. The OCSVM optimization problem can be formulated as follows:  
\[ \begin{split}\underset{\tilde{\varsigma}\in R^{i},\rho\in R}{min}& \frac{1}{2}\|\omega^{2}\|+\frac{1}{\mu l}\sum_{i=1}^{1}\xi_{i}-\rho\\ \text{s.t.}&\Phi(O_{i})\omega\geq\rho-\xi_{i},\xi_{ i}\geq 0\end{split}  \tag{7}\]  
where \(O_{i}\) is the input text feature vector, \(l\) is the number of trained samples, \(\Phi\) is the feature map function that maps the input to the feature space, \(\omega\) and \(\rho\) are the normal vector and offset of the hyper-sphere, \(\xi_{i}\) are the slack variables that denote the coefficient of the regular term, and \(\mu\in(0,1)\) is a hyper-parameter that controls the upper bound of the error sample ratio in the total sample. If \(\omega\) and \(\rho\) are the solutions to the optimization problem, the decision function is:  
\[\text{f}(\text{x})=\text{sgn}(\ \Phi(\text{x})\omega-\rho) \tag{8}\]  
where, for most of the feature vector points in the data set, the value should be positive, and \(\omega\) is relatively small. Thus, by adjusting the hyper-parameter, \(\mu\), we can control the compactness of the constraint boundaries, which is crucial in the process of assigning suitable pseudo-labels to the unlabeled data. To assign suitable pseudo-labels to the unlabeled data, we establish two filtering rules to identify the data with low-confidence pseudo-labels due to model overconfidence. The first rule considers unlabeled samples outside of any boundary as low-confidence anomaly data. The second rule considers unlabeled samples within multiple constraint boundaries as ambiguous data. These filtering methods can effectively eliminate noise from the unlabeled data, screening out high-confidence and unambiguous pseudo-labeled data. After assigning the pseudo-labels to the unlabeled data, we mix the new pseudo-labeled data with the original labeled data and repeat the training of the MMOPL text classification model. We stop the iteration when the performance of the model no longer changes. The purpose of the iterative training process is to learn more monitoring signals that combine fast learning methods and unlabeled data. In Algorithm 1, we describe the iterative training process for easier understanding. First, we treat the mixed training set as the training set (Line 1). Then, we leverage improved prompt learning to obtain an optimal text classification model (Lines 3-8).