# Sudden Event Prediction Based on Event Knowledge Graph
## 4 Methods
### Event Knowledge Graph Construction--Taking the Traffic Domain as an Example  
Based on the event knowledge graph structure given in Section 3.2, this section manually constructs an event knowledge graph for the transportation domain. The construction process firstly collected the traffic news corpus and obtained coarse-grained event classes from the news under the guidance of experts. Secondly, the event granularity was refined layer by layer to get the event classes applicable to event prediction. Then, several event scenario models were constructed using several different event classes, respectively. The relations between the event classes were obtained in the scenario models. Finally, arguments and event relations were labeled from the corpus according to the scenario models and stored. The labeling format is shown in Figure 3. We used the _<Event>_ tag to mark event instances, and the Class attribute to indicate the event class to which the event instance belonged. Each event instance had a unique ID. In the event instance, we marked its arguments with _<Denoter>_, _<Object>_, _<Participant>_, _<Location>_, and _<Time>_ tags. _<Relations>_ brought together all the _<Relation>_ tags. Each _<Relation>_ marked the relation between an event pair and identified this relation with the _relType_ attribute. For different event relations, we recorded the event pairs using different attributes. For a causal relation, _cause_eid_ denoted the initial event and _effect_eid_ denoted the subsequent event. For a follow relation, _aevent_eid_ denoted the initial event and _bevent_eid_ denoted the subsequent event. For a concurrency relation, we also used _aevent_eid_ and _bevent_eid_. Due to the special symmetry of Concurrence, the meaning of these two attributes in Concurrence was equivalent. We collected hundreds of news articles about traffic from China News Network and defined the event classes under the guidance of experts while referring to other field. In this paper, the coarse-grained event categories in the transportation domain were divided into nine categories. Namely road conditions, vehicle loss of control, traffic accidents, road rescue, casualties, impeded safe driving, illegal driving, accident handling, and criminal punishment. Then, the final event class was obtained by subdividing the coarse-grained event class. For example, we subdivided the road condition to get the snow event class, rain event class, and road congestion event class, and subdivided the traffic accident event class to get the crash event class, rear-end event class, rollover event class, and collision  
Figure 3: Data annotation format. Figure 2: Event prediction model. ==ERROR: No output for this page==
```
0:
+++

Message passing and aggregation are important steps in graph neural networks. In an HGT, message passing needs to be accompanied by a calculation of the attention of each relational edge as passing weights. For different edges \(\varphi_{r}=(h,t)\), the attention is obtained by multihead attention splicing, which is calculated as follows:

\[Attention(h,r,t)=Softmax(\underset{i\in[1,h]}{\parallel}ATT-head^{i}(h,r,t)) \tag{8}\]

Each attention head is calculated as follows:

\[ATT-head^{i}(h,r,t)=(K^{i}W^{r}_{att}Q^{i}(t)^{T})\cdot\frac{1}{\sqrt{d}} \tag{9}\]

The different types of head and tail nodes are mapped into Key vectors and Query vectors by different linear mapping functions K-Linear(h) and Q-Linear(t), which can maximize the simulation of the distribution differences of different nodes. Furthermore, unlike the common attention that directly computes the dot product of Key and Query, a heterogeneous mutual attention builds different matrices \(W^{r}_{att}\) for each relational edge, so that the different semantic associations between node pairs due to different relations can be captured.