# Dynamic Scene Segmentation and Sentiment Analysis for Danmaku
## 4 Experiments
### Model Training  
We initialize the model with pre-trained MacBERT weights to leverage the rich linguistic features learned during pre-training. We carefully adjust hyperparameters to optimize model performance. The key hyperparameters and their values are listed in Table 3. The model is trained for 25 epochs with a batch size of 64. We use the AdamW optimizer with a learning rate of \(5\times 10^{-5}\) and a linear scheduler with a warmup ratio of 0.2. The training process is monitored to prevent overfitting, and early stopping is employed if the validation loss does not improve for a certain number of epochs. To see how different sentiment analysis models work on Danmaku data, we perform several experiments. We compare a few models, using both the first and expanded sentiment dictionaries. Table 4 shows the results. The results highlight how much better the performance is when the expanded dictionary is used. Of the models tested, Danmaku-E performs the best. It reaches an accuracy of 94.58% and an F1 score of 94.92% when using the original dictionary. When the expanded dictionary is used, these numbers go up to 95.37% and 95.66%. This improvement shows how well the model uses a large vocabulary to accurately spot and sort subtle emotional expressions in Danmaku comments. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Min-Scene-Length** & **Hist-Similarity-Threshold** & **Number of Scenes** \\ \hline
14 & 0.6 & 15 \\
14 & 0.7 & 14 \\
14 & 0.8 & 13 \\
15 & 0.6 & 14 \\
15 & 0.7 & 13 \\
15 & 0.8 & 12 \\
16 & 0.6 & 12 \\
16 & 0.7 & 11 \\
16 & 0.8 & 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Test Experiment of Merging Scenes. The RoBERTa-BiLSTM model also does very well. It achieves an accuracy of 93.67% and an F1 score of 93.83% when using the original dictionary. Using the expanded dictionary improves its performance to an accuracy of 94.05% and an F1 score of 94.13%. The strengths of this model come from RoBERTa's advanced pre-training abilities, combined with BiLSTM's ability to model sequences in both directions. This combination efficiently captures the complex context and structure in Danmaku text. Similar improvements are noted in the RoBERTa-RNN model. When the expanded dictionary is used, it achieves an increase in its accuracy from 92.79% to 93.41% and its F1 score from 93.02% to 93.72%. There should also be mention of models based on MacBert like MacBert-RCNN and MacBert-BiLSTM. They show significant improvements when the expanded dictionary is used. For example, the accuracy of MacBert-RCNN goes from 90.03% to 91.42%. Its F1 score goes from 90.98% to 91.89%. This shows it is efficient at recognizing a wider range of sentiment-related features. To verify the necessity of each component in scene segmentation and sentiment analysis, we design three sets of ablation experiments, removing the following parts and retraining and testing the model. The experimental results are shown in Table 5.  
The ablation study clearly shows how each component affects model performance. When we remove the scene merging method that uses color histogram similarity, the accuracy dropped by 2.16% and the F1-score fell by 2.21%. This happens because without color guidance, the model makes more over-segmentation mistakes. The original method reduced these errors by 15%, proving it helps keep video scenes properly aligned. Taking out the extended sentiment lexicon causes smaller decreases (0.79% accuracy, 0.74% F1-score). The pretrained RoBERTa model can still understand some slang terms but struggled with rare or new expressions. This means that while the base model handles