# Topic-Specific Emotion Mining Model for Online Comments
## 3 Proposed Model
### Topic-Specific Emotion Mining Model  
In this subsection, we mainly introduce Topic-Specific Emotion Mining model. The emotion topic model, used to discover abstract topics and emotions in text, is a statistical model. It is also called the probability generation model, which is often used in natural language processing and machine learning. The traditional probabilistic generation model is the bag-of-words model. That is to say, the text is represented by a set of words in a bag, which has no interword order or syntactic structure. When a text contains views of different emotional types in many aspects, the word bag method cannot directly convey the text's viewpoint. TSEM is an extension of the traditional probability generation model. We believe that a subjective text is composed of the evaluation object and its corresponding evaluation content. There is a relationship between the evaluation object and the evaluation content, and the text is a set of opinions from different aspects. The different representations of text between a traditional bag-of-words model and the TSEM model are shown in Figure 3.  
The graphical model of TSEM for online comments is shown in Figure 4. Shadow nodes represent the observable data, the unshaded nodes indicate the hidden variables and the arrows mean dependencies. For comment text datasets, the comment time and words for each review are observable. Therefore, they are represented by shaded nodes in the graph model of TSEM. The explanation of notations involved in this paper is shown in Table 1. Usually, a buyer creates the emotion of a topic after determining the topic to be evaluated, instead of the other way around. Different from the traditional emotion-topic models, such as ASUM, emotion label sampling is affected by the topic in our model. Only when the topic and timestamp of a word pair are determined can the emotion of the word pair be generated. TSEM generates each aspect-opinion pair on the basis of the word pair's sentiment and the topic. Our model, combining time, topic, and emotion, allows us to analyze emotional trends of various topics in different periods for reviews, besides grasping the time-specific topics of a product as a whole. Compared with other topic models, TSEM uses aspect-opinion pair distribution, which makes the result of emotion mining more understandable. In this paper, the collection of \(D\) review documents is formalized {\(d_{1}\), \(d_{2}\), \(d_{3}\),..., \(d_{D}\)}. Each review document in the collection is composed of time \(t_{d}\) and a sequence of \(N_{d}\) word pairs, which can be defined as \(d=\{wp_{1}\), \(wp_{2}\), \(wp_{3}\),..., \(wp_{Nd}\), \(t_{d}\)}. Again, we have built an aspect-opinion pair dictionary with \(V\) different items in the preprocessing, from which each word pair in each document is chosen and is denoted in its corresponding index. The value of \(\text{wp}_{i}\) ranges from 1 to \(V\). Time of reviews is divided by 0.25 in this paper, and the number of time  
Figure 3: Representation of text by a traditional word bag model and the Topic-Specific Emotion Mining (TSEM) model. windows is represented by \(T\). Certainly, other time partition granularities can also be opted in line with different demands. The number of topics and emotions are \(K\) and \(E\), respectively. Because of the few neutral views, emotions are classified as positive and negative, ignoring the emotions of neutrality in our work. \(E\) is equal to 2. The generation of a review text \(d\) can be seen as the generation of each word pair in the review. There are three steps for producing an aspect-opinion pair. First of all, one topic label \(z\) is selected from time-specific topic distribution \(\theta_{t}\), where time \(t_{d}\) is known. Then, an emotion label \(s\) is sampled from emotion distribution \(\Pi_{kk}\), when time \(t_{d}\) and topic label \(z\) have been determined. At last, after the determination of topic \(z\) and emotion \(s\), we randomly draw a word pair \(wp\) from the emotion-topic word pair distribution \(\varphi_{zs}\).