# GREG: A Global Level Relation Extraction with Knowledge Graph Embedding
## 3 Model  
The proposed model largely consists of two synchronized modules. While the first module is loosely based around a context-aware LSTM based relation extraction module that was proposed by [PERSON] et al. [16], the second module is a knowledge graph constructor module with the given input as tuples of entities and their relations. The synchronization process is achieved by alternating the two modules during training. The overall process of the module is as shown in Figure 1. The given text is first preprocessed to be divided into sentences which are then passed to a named entity recognition module [17; 18] to identify the entities within the given text. After the identification, the relation extraction module is used to extract local relations from the identified entities within each sentence. Once all relations are extracted, they are used to create a knowledge graph of entities via knowledge graph constructor module. Through this constructor module, the loose relations of entities that are stretched within large bodies of texts are grouped, allowing for extracting global scale relations. To do this, the knowledge graph constructor is assigned to find entities that may act as possible hubs or bridges between other entities. In addition, by acknowledging the type of relations that are between the candidate entities as separate vectors, it will identify if the amalgamation of these vectors does indicate a relation. Once an amalgamation is required, the constructor classifies the global relation based on cosine vector similarity. This indicates that our proposed global relation extraction method is highly dependent on the output from the local relation extraction. Thus, proper synchronization is essential since both modules must consider the other while training themselves. As seen in Figure 2, once the initial training of the local relation extraction module is finished, a set of documents from the training dataset is divided into sentences. These sentences are then given as input. This converts the set of documents composed of sentences into a set of documents composed of local relation triplets. Based on the given local relation triplets, the knowledge graph constructor module aims to construct a knowledge graph containing global and local relations accurately. Initially, the skeleton of the knowledge graph is constructed by using the sum of the local relation triplets. As common nodes between the triplets are used to link each entity, the skeleton knowledge graph contains all the local relation information from the given document input. Once the skeleton knowledge graph is complete, it is then converted into an embedding using the individual vector representations of local relations. Through these embeddings, we can construct new amalgam vector representations by combining the vectors that share entities. These amalgams are then sent to a common classifier used in the local relation extractor module--thus allowing us to identify possible global relations. However, for this module to work, the first and second modules must be synchronized. Thus, every time a knowledge graph is constructed from a document, it is compared to a ground truth knowledge graph, creating an error margin. The synchronization process aims to readjust the knowledge graph embedder, relation classifier, and feature extractor to minimize the error margin. If the synchronization process is successful, the relations will be properly classified regardless of whether it was a local relation or global relation without any drops in performances. Figure 1: Overall process of GREG: Global level Relation Extraction with knowledge Graph embedding. Figure 2: Singular Cycle of Synchronization process: Once the Local Relation Extraction module is trained, a full document is given as input sentence by sentence. The Local Relation info is then used to create a Knowledge Graph(KG). The constructed KG is then compared to a ground truth KG paired with the document. Both KGs are embedded based on the current LR representations.