# Dynamic Scene Segmentation and Sentiment Analysis for Danmaku
## 3 Method
### Sentiment Classification
#### 3.2.2 Model Design  
With this enlarged sentiment dictionary, we create a model for studying sentiment called Danmaku-E. It is built especially to handle Danmaku comments. Figure 2 shows the setup of the Danmaku-E model. This picture shows how using the bigger sentiment dictionary with advanced deep learning methods makes the model better at sorting emotions. BERT, a high-grade deep learning setup, excels at grasping the sense and context ties in natural language. It makes contextualized vector representations for each token (word or subword) in a Danmaku comment. This allows the model to grasp local and global ties in the text. It gives a detailed picture of the comment's meaning and can catch subtle emotional hints that might be otherwise overlooked. Figure 2: The framework diagram of Danmaku-E. The fuzzy feature layer serves as a key component in mapping multi-dimensional sentiment scores onto specific sentiment categories. It is built on the contextual vector representations of tokens generated by the BERT model. These vectors encapsulate rich semantic and contextual information, providing a crucial foundation for subsequent sentiment analysis. We put in a fuzzy feature layer after BERT to improve the mood understanding of the model. This layer's goal is to transform the BERT-generated token-level embeddings into fuzzy features. These represent the level of belonging in different emotional groups. This fuzzy feature layer is key in dealing with the uncertainty and subjectivity often found within human feelings. It allows partial membership in multiple emotional groups, providing a more complex sorting of feelings. This fuzzy feature layer consists of fuzzy variables, membership functions, and fuzzy rules. These define the emotional kinds used to sort feelings. We split feelings into seven main sections: joy, spite, astonishment, sadness, dread, goodwill, and rage. Each of these sections comes with number scores from 0 to 1. Each score shows the intensity of the relative feeling. Using a fuzzy logic setup ensures feelings are sorted correctly and can be interpreted. It accounts for different levels of feelings within each group. To classify the intensity of each emotional score, three membership functions--low, medium, and high--are employed. The representation of the low membership function can be seen in **Formula (3)**. \[\mu_{\text{low}}(x)=\left\{ \begin{array}{rl}0&\text{if }x\leq 0\\ \frac{0.5-x}{0.5}&\text{if }0\leq x\leq 0.5\\ 1&\text{if }x\geq 0.5\end{array} \right. \tag{3}\]  
The medium and high membership functions are set out in **Formulas (4)** and **(5)**. These functions assist in representing the gradual transition in emotional intensity, capturing not only distinct emotions but also transitional states between different emotions. As a result, the model becomes more adept at discerning emotional subtleties. \[\mu_{\text{medium}}(x)=\left\{ \begin{array}{rl}0&\text{if }x\leq 0\\ \frac{0.5}{0.5}&\text{if }0<x<0.5\\ \frac{1-x}{0.5}&\text{if }0.5\leq x<1^{\prime}\\ 0&\text{if }x\geq 1\end{array} \right. \tag{4}\]  
\[\mu_{\text{high}}(x)=\left\{ \begin{array}{rl}0&\text{if }x\leq 0.5\\ \frac{x-0.5}{0.5}&\text{if }0.5<x<1.\\ 1&\text{if }x\geq 1\end{array} \right. \tag{5}\]  
The output fuzzy variable final emotion is defined to represent the final emotion classification result. The output variable ranges from 0 to 7, corresponding to the seven emotion categories. A set of fuzzy rules is defined based on the membership function of emotional scores. If one emotion has a high score and the adjacent emotion has a moderate score, then that emotion category is considered the final emotion. For each rule, the calculation formula for fuzzy reasoning is as shown in **Formula (6)**. \[\text{Rule Strength}= \min(\mu_{1}(x_{1}),\mu_{2}(x_{2}),\ldots,\mu_{N}(x_{N})). \tag{6}\]  
After computing the results of each rule, the centroid method is used for defuzzification.