# Similarity Calculation via Passage-Level Event Connection Graph
## 4 Two Improvements Made on Our Event Connection Graph
### Node Representation via Graph Embedding  
In Section 3, we only choose the nodes which can represent the core event as text representation to calculate text similarity. On one side, except the core event, the information carried by the other events (we call them supplementary events) also provide some useful information. We should not simply abandon them. On the other side, the information carried by the supplementary events is trivial compared with the core event. Thus, there is no need to choose nodes from the event connection graph to represent them. For this reason, we apply graph embedding to integrate the information carried by the supplementary events into the chosen nodes.  
Graph embedding is conducted to embed the graph structure into node representation [47], which can make one node in the graph integrate the information carried by the entire graph. Graph embedding often has a clear target to achieve and the vector representations of the nodes are formed via a bunch of training data, while in our setting, we do not have a clear target to set objective function (to integrate information into the chosen nodes is not a clear target to set objective function) and certainly do not have any training data either. In this situation, we follow self-training approach used in word2 vec, as shown in [48]. We take random walk to generate a set of paths and take these paths as contexts to adjust the vector representations of the nodes. The graph embedding process used to acquire node representation is shown as follows:  
1. Taking \(G_{i}(V,E)\) for example, the event connection graph formed from \(text_{i}\), we treat one node in \(V\) as the starting point and choose the successive node via randomly jumping to one of the adjacent nodes. Repeat this jump for \(l\) times. A path of length \(l\) can be obtained.
2. Repeat step 1 for \(m\) times on each node in \(V\). We then get a path set (noted as \(PH\)) whose size is \(nm\), where \(n\) denotes the size of \(V\).
3. Each path in \(PH\) is treated as one training sample.  
Let \(v_{1},v_{2},\ldots,v_{i-1},v_{i},v_{i+1},\ldots,v_{l-1},v_{l}\) denote one path. The values of \(m\) and \(l\) are set according to [48]. Following self-training setting, we learn a vector representation for \(v_{i}\) to predicate the context of \(v_{i}\). The loss function for it is:  
\[\max P(v_{i-2},v_{i-1},v_{i+1},v_{i+2}|v_{i})=max\prod_{j=1}^{2}P \big{(}v_{i\pm j}\big{|}v_{i}\big{)} \tag{5}\]  
where \(v_{i-2},v_{i-1},v_{i+1},v_{i+2}\) denote the context of \(v_{i}\). Two fully-connected layers are used to train the node representation. Softmax is adopted as the output layer. During the training process, for the first iteration, the node \(v_{i}\) integrates the representations of its adjacent nodes, i.e., \(v_{i-2},v_{i-1},v_{i+1}\), \(v_{i+2}\). For the second iteration, \(v_{i}\) integrates the representations of the nodes which can be linked to \(v_{i}\) through the path whose length is less than 4. As the training process continues, the information carried by the entire graph can be integrated into \(v_{i}\). After graph embedding, we replace the original vector representations of the nodes in the core event by the tuned ones to let the core event integrate the information carried by the entire text and recalculate the similarity between two texts using Equation (1).