# KGGCN: Knowledge-Guided Graph Convolutional Networks for Distantly Supervised Relation Extraction
## 3 Methodology
### Knowledge Supervised Sentences Selection
#### 3.2.1 Knowledge Graph Embedding  
Knowledge graph embedding is an independent work that maps the entities and relations into low-dimensional vector space. In order to learn the vector representation of entities and relations of triples in KGs, the TransE [37] model is the natural choice. For each triple \((e_{1},r,e_{2})\), the explicit relation \(r\) can be treated as the translation from \(e_{1}\) to \(e_{2}\), which is formalized as \(\mathbf{r}=\mathbf{e}_{2}-\mathbf{e}_{1}\). We denote the relations in knowledge graphs as KG-relations. For the encoding of each sentence bag, our model gives each sentence in the bag a confidence score by measuring the semantic distance between the sentence and the KG-relation. As a result, the model can selectively assign higher weights for valid sentences and reduce the impact of noisy sentences by assigning low weights to them.  
We also propose a interactive model to learn the representation of KGs and mine the interactions between the entities and relations. We believe that the confidence of a triple depends on the interaction of the entities and relationships it contains. If the vector distribution of entities and relations in a triple are more similar in the semantic space, the triple has higher confidence. For each triple \((e_{1},r,e_{2})\) in a knowledge graph \(G\), we calculate the interactions between the entities and relation by using the following interaction scoring function:  
\[S_{inter}(e_{1},r,e_{2})=\mathbf{e}_{1}\cdot\mathbf{r}+\mathbf{r}\cdot\mathbf{e}_{2}, \tag{9}\]  
where \(\mathbf{e}_{1},\mathbf{r},\mathbf{e}_{2}\in\mathbb{R}^{d_{w}}\) are low-dimensional vectors of the entities and relation in the triple, \(\mathbf{e}_{1}\cdot\mathbf{r}\) and \(\mathbf{r}\cdot\mathbf{e}_{2}\) are considered as the interactions between \(e_{1}\) and \(e_{2}\) with \(r\), respectively. The interactive scoring function will assign higher scores to the fact triples than negative ones. Based on the above scoring function, we train a margin-based ranking loss function over all triples in \(G\) as follows,  
\[\mathcal{L}_{inter}=\sum_{G}\sum_{G^{\prime}}\max\{0,S_{inter}(\mathbf{e}_{1}^{ \prime},\mathbf{r},\mathbf{e}_{2}^{\prime})-S_{inter}(\mathbf{e}_{1},\mathbf{r},\mathbf{e}_{2})\}, \tag{10}\]  
where  
\[G^{\prime}_{(e_{1},r,e_{2})}=\{(e_{1}^{\prime},r,e_{2})|e_{1}^{\prime}\in E\} \cup\{(e_{1},r,e_{2}^{\prime})|e_{2}^{\prime}\in E\} \tag{11}\]is the collection of negative triples. The negative triples is generated by using the random entities in the knowledge graph to replace the head entity or tail entity in the fact triples. We use stochastic gradient descent (SGD) as optimizer to optimize the loss function and we use a \(L2\) regularization that helps prevent over-fitting. The constraint on the \(L2\)-norm of embeddings are defined as \(\forall(e_{1},r,e_{2}),\parallel e_{1}\parallel_{2}\leqslant 1,\parallel r \parallel_{2}\leqslant 1,\parallel e_{2}\parallel_{2}\leqslant 1\). The model learns an unique vector representation for each entity and relation in the knowledge graph \(G\) and maps it into a low-dimensional semantic space.  
Since the true relations in the test set are unknown, for each entity pair \((e_{1},e_{2})\), we simply define the KG relation embedding \(r_{kg}\in\mathbb{R}^{dw}\) as a translation from \(e_{1}\) to \(e_{2}\), which is formalized as  
\[r_{kg}=e_{2}-e_{1}. \tag{12}\]  
Eventually, the embeddings of the KG relations \(r_{kg}\) can be used as prior knowledge to guide the selection of valid sentences during the aggregation of multiple instances to generate bag-level relation representation.