# Research on Sentiment Analysis of Online Public Opinion Based on RoBERTa-BiLSTM-Attention Model
## 4 Empirical Analysis
### Model Evaluation
Nine experimental control models were selected to evaluate the sentiment classification performance of the RoBERTa-BiLSTM-Attention model and four evaluation metrics were selected for comprehensive evaluation. The evaluation results are shown in Table 6 below. Analysing Table 6 shows the following:  
1. From traditional machine learning models (e.g., SVM and Random Forest) to deep learning models (e.g., LSTM, BiLSTM, BiLSTM-Attention) to pre-trained language models (e.g., RoBERTa, RoBERTa-BiLSTM, RoBERTa-BiLSTM-Attention), the performance of the models is gradually improving. This indicates that deep learning models and pre-trained language models have significant advantages in handling sentiment classification tasks. 2. RoBERTa-BiLSTM and BiLSTM-Attention outperform BiLSTM models. This indicates that the pre-training ability of RoBERTa can significantly improve the model's ability to understand and classify textual data. The feature empowerment ability of attention can better capture the features that have a greater impact on classification decisions. 3. The performance of RoBERTa-BiLSTM-Attention is better than that of RoBERTa-BiLSTM and BiLSTM-Attention. The experimental results show that the accuracy, precision, recall, and F1-score of RoBERTa-BiLSTM-Attention reached 91.56%, 91.77%, 90.27%, and 91.17% respectively, which further indicates that the three-module combination model can improve classification performance. 4. RoBERTa-BiLSTM-Attention outperforms BERT-BiLSTM-Attention and RoBERTa-ResNeXt-BiLSTM. RoBERTa's improvement in the pre-training strategy and its advantage in semantic capture ability enable the model to more accurately identify and \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **Accuracy** & **Precision** & **Recall** & **F1-Score** \\ \hline SVM & 0.7319 & 0.7318 & 0.7218 & 0.7220 \\ \hline Random forest & 0.7406 & 0.7401 & 0.7328 & 0.7420 \\ \hline LSTM & 0.7584 & 0.7543 & 0.7457 & 0.7529 \\ \hline BiLSTM & 0.7963 & 0.7954 & 0.7841 & 0.7876 \\ \hline BiLSTM–Attention & 0.8316 & 0.8283 & 0.8134 & 0.8271 \\ \hline RoBERTa & 0.8359 & 0.8309 & 0.8278 & 0.8290 \\ \hline RoBERTa–BiLSTM & 0.8878 & 0.8819 & \(-\)0.8756 & \(-\)0.8769 \\ \hline BERT–BiLSTM–Attention & 0.8727 & 0.8718 & 0.8727 & 0.8729 \\ \hline RoBERTa–BiLSTM–Attention & 0.9156 & 0.9177 & 0.9027 & 0.9117 \\ \hline RoBERTa–ResNeXt–BiLSTM & 0.9089 & 0.9068 & 0.8978 & 0.9034 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Comparative evaluation of models. classify texts of different sentiment categories. RoBERTa-BiLSTM-Attention shows higher accuracy and stronger sentiment expression processing ability in sentiment classification tasks, but the computational complexity and training times are greater. On the other hand, RoBERTa-ResNeXt-BiLSTM is more advantageous in terms of training efficiency and computational complexity but is inferior to RoBERTa-BiLSTM-Attention in terms of performance. In summary, the RoBERTa-BiLSTM-Attention model can effectively improve the model's text feature capture ability and contextual context understanding ability by combining the pre-training ability of RoBERTa, the sequence processing ability of BiLSTM, and the feature focusing ability of the attention mechanism. In addition, the model combining sentiment dictionary and annotation can, on the one hand, save the costs of manual annotation and improve the classification accuracy. On the other hand, it can provide support for subsequent research and decision-making regarding the sentiment analysis of food safety events at universities.