# Rumor Detection Based on Attention CNN and Time Series of Context Information
## 3 Problem Statement and Proposed Solution
### Time Series Grouping and Extraction of Sentimental Characteristics
 \tag{9}\]  
Figure 3: Schematic diagram of the SVM model used to detect emotion polarity. In which \(\chi^{2}(w,s)\) represents the chi-square measurement of word \(w\) in the sentiment category \(s\), \(N\) represents the size of the sentiment training data set, \(p(s,w)\) represents the number of texts containing the word \(w\) in the sentiment category \(s\), \(p(\overline{s},w)\) represents the number of texts containing word \(w\) that exclude sentiment category \(s\), \(p(s,\overline{w})\) represents the number of texts that do not contain word \(w\) in emotion category \(s\), and \(p(\overline{s},\overline{w})\) represents no sentiment category \(s\) and no word \(w\). Using Equations (8) and (9), the chi-square statistics of each word in a certain sentiment category can be calculated. Additionally, a sentiment feature threshold value can be set for each category to make the feature vector more distinguishable. Then, the sentiment feature word is combined as the emotions feature vector. The obtained sentiment feature vector is input into the SVM model for training and save the model with the best effect. The test set is the main data set of this research which contains rumor and non-rumor data. After dividing them into 20 groups according to the time series, each group contains \(m\) posts. Additionally, each post in each group is subjected to chi-square statistics to obtain the corresponding sentiment feature vector which is used as the input of the SVM model to obtain each post. Then, the sentiment polarity of posts of each group was obtained by the SVM model. The sentiment tendency features of each time series grouping are calculated by the Equation (10). \[ \begin{array}{c} Sentiment\_feature_{i}=\frac{sum(positive\_words_{i})}{m}\\ i=1,2,3,\ldots,20\end{array}  \tag{10}\]  
In which, \(i\) is the group number and \(m\) is the number of posts contained in each group. \(positive\_words_{i}\) is the word with positive part of speech in group \(i\). \(sum\) is function which can calculate the number of positive words. The reason for this operation is: the sentiment polarity of the post is divided into positive, negative and neutral. If the \(Sentiment\_feature_{i}\) value is high, it means that the posts in the group are positive and the number of negative and neutral posts is small; otherwise, they are negative and neutral and the number of positive posts is small and the two correspond to each other. The CNN Model with the Attention Mechanism That Combines Sentimental Characteristics and Time Series  
The convolutional neural network model with the attention mechanism is shown in Figure 4. Regarding the input of the CNN with the attention mechanism, the whole rumor event is divided into 20 groups by the time series algorithm. The text vector features and sentiment polarity features in different time series are obtained by the Doc2 Vec algorithm and the SVM algorithm, respectively, (see Section 3.4 for details). Figure 4: Convolutional neural network model with the attention mechanism. In terms of the input of CNN model, \(LF_{ij}\) represents the feature vector of the \(j\)th group of the rumor event \(E_{i}\) and its dimension is \(k+1\). A feature vector of a microblog rumor event containing \(n\) groups of related microblogs is represented, as shown in Equation (11), where \(n\) takes 20, and \(\oplus\) represents series operation. \[E_{i}=LF_{i1}\oplus LF_{i2}\oplus LF_{i3}\oplus\ldots\oplus LF_{in} \tag{11}\]  
\(LF_{i,j}\) is formed by connecting the text vector and the emotional polarity feature in each group. In this equation, \(i\) is the \(i\)th event, \(j\) is the \(j\)th group divided by time series. Its calculation is shown in Equation (12), where \(n\) takes 20, \(F_{i,j}\) is the text vector in each group, \(e_{i,j}\) is the sentiment polarity characteristic, \(\oplus\) represents series operation. Finally, these 20 vectors are used as the input of convolution neural network.