# Sudden Event Prediction Based on Event Knowledge Graph
## 4 Methods
### Event Knowledge Graph Construction--Taking the Traffic Domain as an Example
The final dataset contained a total of 510 event instances in 15 event classes. Our final prediction results contained a total of 13 event classes. The final event classes and the number of event instances they contained are shown in Table 2. The delineated dataset was used to generate subgraphs for training and testing according to the method given in Section 4.2. As we mentioned earlier, when generating the subgraphs, a central node with \"event\" as the default text was created for each event instance. Experimental setup: We use [PERSON] [31] as the optimizer, all models had a learning rate of 0.0006, the number of multiheaded attention layers were all set to four, the hidden layer dimension was set to 400, and the input-output dimension was 768. We set the number of training epochs to 100. To measure our model performance, we used accurate matching as \begin{table}
\begin{tabular}{c c} \hline \hline
**Event Class** & **Event Instance Number** \\ \hline Death & 101 \\ CarCash & 68 \\ TreatTheInjured & 57 \\ AccidentInvestigation & 50 \\ SeriousInjury & 43 \\ MinorInjury & 35 \\ Sideslip & 28 \\ PersonnelRescue & 27 \\ Rollover & 21 \\ Arrest & 17 \\ ModerateInjury & 15 \\ Speeding & 14 \\ PeopleCrash & 13 \\ Tailgate & 13 \\ FatigueDriving & 8 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Event classes and data volume. a measure of the model's predictive power. Accurate matching is the ratio of the number of samples whose prediction result is exactly the same as the ground truth to the total number of samples. For the data that were not perfectly matched, we calculated precision, recall, and \(F1\) values following the method of [PERSON] et al. [32]. Precision can be viewed as the probability of each event occurring in the prediction results given by the model, and recall represents how many events the model successfully predicted out of all upcoming events. Precision, recall, and \(F1\) values were calculated as follows. Let \(T\) be the true label set and \(S\) be the predicted label set. The standard IR measures of precision (\(P\)), recall (\(R\)) and \(F1\) are defined in the multilabeled classification setting as follows

\[P=|T\cap S|/|S| \tag{15}\]

\[R=|T\cap S|/|T| \tag{16}\]

\[F1=2 PR/(P+R) \tag{17}\]

### Experiments

We experimentally validated the effectiveness of the HGEP model. In addition to the HGEP model, we also implemented models using a graph attention neural network [33] and graph convolution neural network [34] to obtain event feature representations as a baseline, hereafter referred to as GAT and GCN. We also used RoBERTa [35] and BERT [36] as embedding layers, respectively, to compare with the HGEP model using XLNet. We used pretrained basic versions of BERT, RoBERTa, and XLNet, which were retrained by the HFL lab based on a large Chinese corpus. People can get these open-source models at github.com/ymcui. The difference between graph attention networks and graph convolutional networks is how they aggregate information from one hop: graph convolutional operations produce normalized sums of neighboring node features and graph neural networks introduce an attention mechanism instead of static normalized convolutional operations. Both are similar in that they are designed for isomorphic graphs and only consider different types of nodes, not different types of edges. In this paper, we extended the graph attention to a heterogeneous graph attention by assigning different weights to each type of edge in the graph and applying this weight to the message delivery and aggregation. We give the experimental results in Table 3, from which we can see that the model in this paper outperformed the prediction models using GCN and GAT in terms of accurate matching values and accuracy. The reason why the model in this paper was lower than GCN and GAT in the recall value, we believe is due to the fact that the model became more conservative in making predictions with higher accurate matching value, which resulted in fewer correct and incorrect predictions.