# Trend Prediction of Event Popularity from Microblogs
## 3 Methodology
### Popularity Trend Prediction  
Firstly, before modeling Bi-LSTM network for prediction, this paper needs to build the basic model, LSTM network, in order to solve sequence-to-label modeling for microblog data. In memory block of LSTM network model, there are one or more self-connected memory blocks and three multiplication units: input unit, output unit and forgetting unit. The input unit is mainly used to store the current information while the output unit is used to output the state trend changes of microblog events. Meanwhile, the forgetting unit is designed to filter valuable information and selectively forget certain past information. The network structure of LSTM model is shown as Figure 3.  
Figure 2: The structure of the box plot. At each time node, the event popularity is considered as the input sequence, and the state trend data is represented as the output. Meanwhile, the input unit, output unit and forgetting unit correspond to \(i_{t},o_{t},f_{t}\) respectively. Specifically, the forgetting unit takes the current output and the previous hidden-layer-state output as input, and uses sigmoid activation function to control the unit to discard redundant information. Finally, the value of state trend, between 0 and 1, can be calculated by Formula (12). \[f_{t}=\delta_{g}(w_{f}x_{t}+U_{f}h_{t-1}+b_{f}) \tag{12}\]  
In Formula (12), the weight matrix that maps the hidden layer input to the forgetting unit is denoted as \(w_{f}\), and \(U_{f}\) represents the weight matrix that connects the output state of the previous time node to the forgetting unit. Additionally, this paper uses the symbol \(b_{f}\) and \(\delta_{g}\) to denote the offset vector and activation function, respectively. After the information passes through the forgetting structure, the LSTM model will consider which new information to add to the unit. The added information is jointly controlled by the hidden layer state output of the previous time node \(h_{t-1}\) and the current input \(x_{t}\). Through the activation function \(tanh\), the new state output \(\widetilde{C}_{t}\) is obtained. And the weight between 0 and 1 is added to each component of \(\widetilde{C}_{t}\) to control the amount of new added information by Formulas (13) and (14). \[i_{t}=\sigma_{g}(W_{i}x_{i}+U_{i}h_{t-1}+b_{i}) \tag{13}\]  
\[\widetilde{C}_{t}=\tanh(W_{c}x_{t}+U_{C}h_{t-1}+b_{c}) \tag{14}\]  
\(W_{i}\) and \(W_{C}\) refer to weight matrices, which map the hidden layer input to the traditional input unit and input unit states, respectively. \(U_{i}\) and \(U_{C}\) refer to weight matrices, connected to the previous unit, which map the output states to the input unit and input unit states. And the deviation vectors are defined as \(b_{i}\) and \(b_{C}\). In addition, when information is forgotten by forgetting unit, the new unit state is updated by Formula (15). \[C_{t}=f_{t}\cdot C_{t-1}+i_{t}\cdot\widetilde{C}_{t} \tag{15}\]  
Finally, the state of the output unit is calculated according to the following two Formulas (16) and (17). \[o_{t}=\sigma_{g}(W_{o}x_{t}+U_{o}h_{t-1}+b_{o}) \tag{16}\]  
\[h_{t}=o_{t}\cdot\tanh(C_{t}) \tag{17}\]  
Here \(W_{o}\) is the weight matrix of the hidden layer to the output unit and \(U_{o}\) is the weight matrix of the output state of previous unit to the output unit. Meanwhile, this paper uses the symbol \(b_{o}\) to represent the deviation matrix. Based on LSTM modeling structure, this paper aims to construct the Bi-LSTM network to explore and predict the hidden layer state of popularity time series. More specifically,  
Figure 3: The network structure of LSTM model. forward LSTM and reverse LSTM can obtain the past information and future information in time series, respectively. The following three Formulas (18)-(20) can reflect the mechanism of Bi-LSTM model in our work. \[\overset{\rightarrow}{h}_{t}=L\overset{\rightarrow}{STM}(h_{t-1},x_{t},C_{t-1} ),t\in[1,T] \tag{18}\]  
Figure 2:0  
Figure 2:1  
The symbol \(T\) refers to the time span of microblog event. And the structure of Bi-LSTM network is shown in Figure 2:2