# GREG: A Global Level Relation Extraction with Knowledge Graph Embedding
## 3 Model
### Knowledge Graph Constructor  
However, the info extracted from the relation extraction module are only local relations limited to sentences. To expand our extraction to global relations, the second module receives the results from the first module. For each local relation, the two entities involved are considered as coordinates and are paired together with the relation's vector representation \(o_{v}\). These local relations and their representations are each used to construct the skeleton of a knowledge graph and its embedding.  
As the initial knowledge graph is only a skeleton constructed from local relations, it does not contain any global relations as a ground truth knowledge graph would. Considering that the knowledge graph skeleton's embedding is composed of \(O=\{v^{1},v^{2},v^{3},\ldots,v^{n}\}\), we hypothesize that the true knowledge graph embedding should be composed of \(T=\{t^{1},t^{2},t^{3},\ldots,t^{k}\}\). The reason behind why we 'hypothesize' the knowledge graph is because, as we do not know what the values of the true knowledge graph's relation vector would be, we cannot get a ground truth embedding of it. Thus, the purpose of the second module is to'recover missing' embedding components from \(T\) by using the skeleton knowledge graph's embedding \(O\). These'missing' embedding components are most likely global relations embeddings. In addition, the once recovered embeddings form knowledge graph \(O^{\prime}=\{v^{1},v^{2},v^{3},\ldots,v^{k}\}\) and the newly founded embeddings in \(O^{\prime}\) are used to extract global relations.  
Since global relations can be broken down into multiple intermediate local relations. This can also mean that the sum of the intermediate relations shall indicate a global relation. For our ideal ground truth knowledge graph, its embedding should reflect this as well. Thus, the amalgamation of multiple intermediate local relation vectors should result in an accurate global relation vector within the knowledge graph's embedding. For example, if a fixed local relation vector with coordinate \((e_{1},e_{2})\) is represented by \(v_{a}\) and fixed local relation vector with coordinate \((e_{2},e_{3})\) is represented by \(v_{b}\), then the global relation vector \(v_{c}\) of \((e_{1},e_{3})\) must be represented as \(\|v_{c}\|\approx\|v_{a}\oplus v_{b}\|\).  
In addition, as each relation is represented as a vector, the vectors are required to represent global relations with the same consistency shown in local relation classification. Thus, if a global relation and a local relation are the same class, both vector representations must yield similar classification results. For example, let's say that the global relation of \(\overrightarrow{AC}\) is \"daughter\" and local relation \(\overrightarrow{XY}\) is also \"daughter\". In addition, the given intermediate local relation from \(\overrightarrow{AC}\) is \(\overrightarrow{AB}\) as \"son\" and \(\overrightarrow{BC}\) as \"sister\". If consistency is to be met, the amalgam representation vectors of \(\overrightarrow{AB\oplus BC}=\overrightarrow{AC}\) should yield the same results as that of \(\overrightarrow{XY}\) when it is classified by the relation classifier from the context-aware relation extraction module. In addition, as the global relation is classified, it becomes possible to convert the knowledge graph embedding back into a knowledge graph. Thus, the construction of a fully intact knowledge graph, including both local and global relations, of the document is finished.  
However, during the early stages of training, this will most likely not be the case. Since amalgams of local relation vectors will not properly represent global relation when concatenated, to make this possible, as well as preserve the performance on local relation extraction, it needs to go through the 'Synchronization process'.