# Weibo Text Sentiment Analysis Based on BERT and Deep Learning
## 5 Experiment and Analysis
### Experimental Results  
In order to evaluate the performance of our proposed model, we randomly divide the dataset into ten parts, using nine of them as the training set and validation set, the remaining one part as the test set, taking the results as the evaluation result of our model. As we all know, the performance of the model is affected by the number of iterations. Therefore, the optimal number of iterations suitable for the model is explored here through experiments. The experimental results are shown in Figure 5 and Table 2. It can be seen that, when the number of iterations is eight, the performance of the model is optimal. When the number of times is greater than eight, the performance of the model begins to decline, which is caused by the phenomenon of overfitting. When the number of times is less than eight, the performance of the model is also not optimal due to the insufficient ability of learning features. The input length of the text also affects the performance of the model. Therefore, choosing an appropriate input text length is very important. If the review length is larger than the selected length, it is intercepted, and if the review length is smaller than the selected length, 0 will be added. We chose the maximum text length of 648 and the average text length of 12 in the dataset for the experiment. The experimental results are shown in Table 3 and Figure 6. Through experiments, it can be seen that when the selected input text length is the average text length, the performance of the model is better. This is because the Weibo data is mostly short text. If a longer text length is selected, most texts need to be filled with a lot of zeros. Filling reduces the accuracy while increasing the time loss, thereby reducing the performance of the model. We introduced the dropout value in the model to increase the generalization ability of the model, prevent the model from overfitting, and the performance of the neural network has been further improved. We set up different dropout values for comparison experiments, and learned through experiments that when the dropout value is equal to 0.6, the experimental result is the best. The dropout value at this time can effectively prevent the occurrence of model overfitting. The experimental results are shown in Table 4 and Figure 7. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Epoch** & **Accuracy** & **Precision** & **Recall** & **F1** \\ \hline
3 & 91.6\% & 94.4\% & 88.3\% & 91.3\% \\ \hline
5 & 91.5\% & 94.9\% & 87.8\% & 91.2\% \\ \hline
7 & 91.7\% & 94.7\% & 88.3\% & 91.4\% \\ \hline
8 & 92.6\% & 93.8\% & 91.4\% & 92.6\% \\ \hline
9 & 92.1\% & 92.6\% & 91.5\% & 92.0\% \\ \hline
11 & 91.2\% & 88.4\% & 95.0\% & 91.6\% \\ \hline
13 & 91.6\% & 92.9\% & 90.3\% & 91.6\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Experimental results of iterative experiments. Figure 5: Experimental results of iterative experiments. Through the above experiments, the best parameters of the model are obtained. The parameter settings of the model are shown in Table 5: \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dropout** & **Accuracy** & **Precision** & **Recall** & **F1** \\ \hline
0.2 & 92.1\% & 94.2\% & 90.0\% & 92.0\% \\ \hline
0.3 & 92.2\% & 93.5\% & 90.6\% & 92.0\% \\ \hline
0.4 & 91.8\% & 89.4\% & 94.9\% & 92.1\% \\ \hline
0.5 & 92.2\% & 92.3\% & 91.9\% & 92.1\% \\ \hline
0.6 & 92.7\% & 93.0\% & 92.4\% & 92.7\% \\ \hline
0.7 & 90.5\% & 86.8\% & 95.3\% & 90.8\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Experimental results of dropout value. Figure 6: Experimental results of text length. Figure 7: Experimental results of text length. The experiment was conducted on the collected Weibo text dataset related to the COVID-19 epidemic. The experimental results of the proposed model and other competitive models are shown in Table 6. We can divide the competition model into three parts.