## 3 Method
### Event Tree Generation
#### 3.5.2 Event Tree Updating  
When obtaining a new life story document \(d_{new}\), we perform one of three operations to insert \(d_{new}\) into an existing event tree: merge, extend, or create a new branch [30]. The pseudocode for the event tree updating process is shown in Algorithm 1.  
```
1:\(d_{new}\) represents the newly inserted life story, \(T_{n}=\{B_{1}\langle E_{11},\cdots E_{1n}\rangle,B_{2}\langle E_{21},\cdots,E_ {2n}\rangle,\cdots B_{m}\langle E_{m1},\cdots,E_{mn}\rangle\}\) represents the current event tree, which consists of multiple events \(\{E_{11},\ldots,E_{m}\}\) and multiple branches \(\{B_{1},\ldots,B_{m}\}\). The threshold for event similarity is 0.88, and the threshold for events belonging to the same cluster is 0.65.
2:\(T_{new}\) represents the latest event tree after inserting a new life story.
3:Initialize \(\varrho_{new}\gets E(d_{new})\)
4:Initialize \(\phi_{k}\gets 0\)
5:Initialize \(\phi_{max}\gets 0\)
6:Initialize \(\phi_{k}\gets Nil\)
7:Initialize \(B_{\phi}\gets Nil\)
8:for\(B_{i}\) in \(T_{n}\)do
9:for\(E_{ij}\) in \(B_{m}\)do
10:\(\phi_{E}\leftarrow\phi_{E}(\widetilde{E}_{ij}.\widetilde{e_{new}})\)
11:if\(\phi_{E}>\phi_{max}\)then
12:\(\phi_{max}\leftarrow\phi_{e}\)
13:\(e_{\phi}\gets E_{ij}\)
14:\(B_{\phi}\leftarrow B_{i}\)
15:endif
16:endfor
17:if\(\phi_{max}<0.65\)then
18:\(T_{new}\leftarrow\)\(B_{1}\langle E_{11},\cdots E_{1n}\rangle,B_{2}\langle E_{21},\cdots,E_{2n}\rangle, \cdots B_{m}\langle E_{m1},\cdots,E_{mm}\rangle,B_{new}\)
19:elseif\(\phi_{max}<0.88\) and \(\phi_{max}>0.65\)then
20:\(B_{i}\gets AppendEvent(B_{i},e_{new})\)
21:\(T_{new}=\{B_{1}\langle E_{11},\cdots E_{1n}\rangle,B_{i}\langle E_{i1},\cdots,E_{in},e_{new}\rangle,\cdots B_{m}\langle E_{m1},\cdots,E_{mn}\rangle\}\)
22:else
23:\(E_{ij}\gets MergeEvent(E_{ij},e_{new})\)
24:\(T_{new}=\{B_{1}\langle E_{11},\cdots E_{1n}\rangle,B_{2}\langle E_{21},\cdots,E_{2n}\rangle,\cdots B_{m}\langle E_{m1},\cdots,E_{mn}\rangle\}\)
25:endif
```  
**Algorithm 1** Event Tree Update Process  
The merge operation is to merge the new life story document \(d_{new}\) to an existing event node \(E_{i}\) in the tree. We first extract the event \(e_{new}\) from \(d_{new}\) and generate its feature based on the bilayer graph. Then, we compare it with each event node \(E_{i}\) in the given event tree. If we find several events with a correlation greater than a given threshold, i.e., 0.88, we merge this life story with the event node with the highest correlation by adding the document to the node.  
The extend operation is to generate a new event node for the new life story document and insert it into the branch it belongs to. This operation happens when we cannot find an event node that describes the same event as \(d_{new}\) and we can find an event group to which \(d_{new}\) belongs. We compare the new event with existing events and find the event node \(E_{i}\) with the largest correlation. If this correlation is greater than a given threshold, i.e., 0.6, we then use the cluster that \(E_{i}\) belongs to as the new event's cluster. We then create an event node based on the generated event features and insert it into the corresponding event branch according to the time distance or event similarity, following the procedures mentioned in Section 3.5.1. The topic node of this branch will also be updated following the topic node generation procedures mentioned in Section 3.5.1.  
The create a new branch operation is to create a new topic node and generate a new event branch with the new life story document. The event extracted from this story will be the first event in this new branch. The topic node and the event branch generation also follow the procedures mentioned in Section 3.5.1.