# Sudden Event Prediction Based on Event Knowledge Graph
## 4 Methods
### Event Knowledge Graph Construction--Taking the Traffic Domain as an Example
In the information transfer phase from the head node to the tail node, this step is parallel to the computation of mutual attention and has the main role of transferring information about the arguments and neighboring events to the current event node. The transfer of information from the head node to the tail node through different relational edges can be computed as:

\[Message(h,r,t)=\underset{i\in[1,h]}{\parallel}\ MSG-head^{i}(h,r,t) \tag{10}\]

\[ATT-head^{i}(h,r,t)=Linear^{i}(H^{(l-1)}[s])W^{msg}_{r} \tag{11}\]

The multiheaded message is similar to the multiheaded attention calculation method, where the incoming upper-level message is projected through different linear layers to get different message headers, and multiple message headers are stitched together to get _Message(h, r, t)_ passed from each head node to the tail node. Finally, to aggregate messages, graph neural networks are generally aggregated by Add, Mean and Max, and we used Add in our approach. For the messages from the head nodes, they were averaged using the attention vector as the weight, and then the messages from each head node were summed to obtain the updated vector. \[\hat{H}^{[t]}=\oplus(Attention(h,r,t)\cdot Message(h,r,t)) \tag{12}\]

Finally, after the activation with ReLu, we used a linear layer after \(\hat{H}^{[t]}\) mapping back to the embedding dimension to fuse the neighbor information into the original nodes. The model took one-hop nodes at a time, and since the initial event nodes did not contain information, the event nodes aggregated information about the arguments after one representation layer, and at least one additional representation layer was needed to obtain information about concurrent events. In fact, we used a total of four characterization layers to obtain our desired scenario representation. ### Model Training and Prediction Results

We formulated the training task as a multilabel classification task, with the event class to which all tail events belonged as the true labels G for comparison with our prediction results P. The model was optimized using MultiLabelSoftMarginLoss as the loss function to reduce the prediction of mislabeling, and the loss is calculated as follows:

\[loss(P,G)=-\underset{i}{\sum}G[i]*log(1+exp(-P[i])^{-1})+(1-G[i])*log(\frac{ exp(-P[i])}{1+exp(-P[i])}) \tag{13}\]The prediction results were obtained as shown in Equation (2), using sigmoid and log_softmax functions to resolve the probability of the event occurrence. To enhance the prediction ability, the prior value \(\lambda\) was added to adjust the prediction results in the experiment. Using \(sig()\) to denote the \(Sigmoid()\) function and \(l\_s()\) to denote the \(log_{s}oftmax()\) function, the final prediction formula is shown below:

\[P(H(t))= \begin{cases}1,&\text{if }sig(l\_s(Linear(H(t))))\geq\lambda;\\ 0,&\text{if }sig(l\_s(Linear(H(t))))<\lambda;\end{cases}  \tag{14}\]

where \(Linear(H[t]):R^{d}\to R^{n}\) and \(n\) is the prediction category. ## 5 Results

In this section, we used a real dataset to evaluate our model. We used different graph neural networks as representation layers and different language models as embedding modules for comparison and compared the impact of different event graphs on the prediction results. ### Dataset and Experimental Setup

Dataset: Our dataset came from hundreds of related news articles crawled by the China News Network, and we filtered more than 100 high-quality data for chapter-level event and event relation labeling. Finally, we obtained a dataset containing about 510 events and 500 event relation pairs in 35 event classes. In order to ensure the data quality and retain as many events as possible, we removed the event classes containing too few event instances and divided the training and testing sets in a 7:3 ratio according to the event classes to which the event instances belonged. We tried to keep as many event classes as possible while keeping the results valid. After some trials, we removed the event classes with less than eight event instances.