## 3 Proposed Methodology
### Algorithm Flow of TextCNN + RoBERTa and RNN_Bert_Based
The objective of this section is to provide a comprehensive understanding of the methodologies employed, offering insights into the strengths and limitations of the proposed approach in comparison with previously established models. ### Datasets and Evaluation Metrics

In this paper, the SST-2 [39] dataset is selected as the experimental dataset. The SST-2 dataset is a challenging dataset for text classification tasks. The dataset is a popular resource for sentiment analysis, consisting of 11,855 movie review sentences labeled for binary sentiment classification as either positive or negative. The dataset is split into a training set of 8544 sentences, a testing set of 2210 sentences, and a validation set of 1101 sentences. A large portion of the dataset with 72% is allocated to training. This ensures that the model is exposed to a diverse range of examples, allowing it to generalize well to new data. The more data it sees during training, the better it learns the underlying patterns in the data. Next, a smaller proportion, about 9% of the dataset, is allocated to validation. This is sufficient to monitor the model's performance without wasting too much data that could have been used for training. The validation set helps prevent overfitting by providing a reality check on the model's performance on unseen data. This way, the model does not just memorize the training data but generalizes well to new examples. It also aids in tuning the model's hyperparameters for optimal performance. In this case, the test set is around 18% of the total data. This amount is sufficient to give a reliable estimate of model performance across a variety of examples while still preserving enough data for training and validation. Figure 1 illustrates the labeling and sentence length analysis of the SST-2 training set. In classification problems, metrics such as accuracy, precision, recall, and F1 score are typically employed to assess the performance of classification models. According to the confusion matrix, the experimental results can be classified into four categories: true positive (TP), false positive (FP), true negative (TN), and false negative (FN). Among these, TP denotes the number of texts with positive actual labels and positive model predictions; FP denotes the number of texts with negative actual labels but positive model predictions; FN denotes the number of texts with positive actual labels but negative model predictions; TN denotes the number of texts with negative actual labels and negative model predictions. The accuracy, precision, recall, and F1 score are calculated as follows:

\[Accuracy=\frac{TP+TN}{TP+FP+TN+FN}*100\% \tag{4}\]

\[Precision=\frac{TP}{TP+FP}*100\% \tag{5}\]

\[Recall=\frac{TP}{TP+FN}*100\% \tag{6}\]

\[F1\,score=\frac{2*Precision*Recall}{Precision+Recall}*100\% \tag{7}\]

The above formula indicates that the accuracy is the ratio of correctly classified samples to the total number of samples. This reflects the overall performance of the classifier. However, when there is a category imbalance in the dataset, the accuracy rate may be distorted because the classifier may tend to predict the category with a higher number of samples. Accuracy is the percentage of samples that the classifier predicts to be positive that are actually positive cases. The recall rate is the proportion of positive examples that are correctly identified as such by the classifier. When the samples are imbalanced, the precision and recall rates can provide a more accurate reflection of the classification performance of the model, although they may not fully capture the prediction ability of negative samples. The F1 score is the average of the precision and recall rates, which can combine the prediction accuracy and recognition ability of the classifier. However, the F1 score assigns equal weight to precision and recall, which may result in the overlooking of certain metrics that should be accorded greater importance.