# Entity Alignment Method Based on Joint Learning of Entity and Attribute Representations
## 2 Materials and Methods
### Entity Alignment  
By jointly learning the structural embeddings and attribute character embeddings, the entity embeddings of \(KG_{1}\) and \(KG_{2}\) can be placed into a unified vector space. Additionally, similar entities will have short semantic distances, defined as:  
\[E(\mathbf{e}_{1},\mathbf{e}_{2})=\left\|\mathbf{e}_{1}-\mathbf{e}_{2}\right\|_{L_{2}},\forall e _{1}\in E_{1},\forall e_{2}\in E_{2} \tag{19}\]  
Given some unaligned entity \(\hat{\mathbf{e}}_{1}\) in \(KG_{1}\), the aim of entity alignment is to identify the unaligned entity \(\hat{\mathbf{e}}_{2}\) in \(KG_{2}\) with the minimum semantic distance to \(\hat{\mathbf{e}}_{1}\), i.e., \(\hat{\mathbf{e}}_{2}=\underset{\mathbf{e}_{2}}{\operatorname{argmin}}\left\|\hat{\mathbf{ e}}_{1}-\mathbf{e}_{2}\right\|_{L_{2}}\). Furthermore, we define a semantic distance threshold hyperparameter \(\theta\), such that \(\left\|\hat{\mathbf{e}}_{1}-\hat{\mathbf{e}}_{2}\right\|_{L_{2}}<\theta\), \(\hat{\mathbf{e}}_{1}\) and \(\hat{\mathbf{e}}_{2}\) are deemed to refer to the same real-world entity. These considerations form the basis by which the entities in \(KG_{1}\) and \(KG_{2}\) are aligned.  
To perform entity alignment, we first construct an aligned entity set \(M=\{(\hat{\mathbf{e}}_{1},\hat{\mathbf{e}}_{2})\}\) and minimize the loss function shown in Equation (20):  
\[L_{EA}=\sum\limits_{(\hat{\mathbf{e}}_{1},\hat{\mathbf{e}}_{2})\in M}(L_{EA-SE}(\hat{ \mathbf{e}}_{1},\hat{\mathbf{e}}_{2})+L_{EA-SE}(\hat{\mathbf{e}}_{2},\hat{\mathbf{e}}_{1})+L_{ EA-CE}(\hat{\mathbf{e}}_{1},\hat{\mathbf{e}}_{2})+L_{EA-CE}(\hat{\mathbf{e}}_{2},\hat{\mathbf{e}}_{1})) \tag{20}\]  
where the expressions of \(L_{EA-SE}(\hat{\mathbf{e}}_{1},\hat{\mathbf{e}}_{2})\), \(L_{EA-SE}(\hat{\mathbf{e}}_{2},\hat{\mathbf{e}}_{1})\), \(L_{EA-CE}(\hat{\mathbf{e}}_{1},\hat{\mathbf{e}}_{2})\) and \(L_{EA-CE}(\hat{\mathbf{e}}_{2},\hat{\mathbf{e}}_{1})\) are shown in Equations (21)-(24), respectively.  
\[L_{EA-SE}(\hat{\mathbf{e}}_{1},\hat{\mathbf{e}}_{2})=\sum\limits_{(h,r,t)}\left[\left\| \hat{\mathbf{e}}_{2}\mathbf{M}_{r}+\mathbf{r}-\mathbf{M}_{r}\right\|_{L_{2}}-\gamma_{1}\right] _{+}+\sum\limits_{(h,r,t)}\left\{\frac{1}{2}\sum\limits_{p\in P(h,t)}R(p|\hat{ \mathbf{e}}_{2},t)\left[\left\|\hat{\mathbf{e}}_{2}+\mathbf{p}-\mathbf{t}\right\|_{L_{2}}- \gamma_{1}\right]_{+}\right\} \tag{21}\]\[L_{EA-\text{SE}}(\ell_{2},\ell_{1})=\sum\limits_{(k_{2},r)}\Bigl{[} \left\lVert\hat{\mathbf{e}}_{1}\mathbf{M}_{r}+\mathbf{r}-\hat{\mathbf{u}}_{1}\mathbf{M}_{r}\right\rVert _{L_{2}}-\gamma_{1}\Bigr{]}_{+}+\sum\limits_{(k_{2},r,k)}\Biggl{\{}\frac{1}{2} \sum\limits_{p\in\tilde{P}(k_{1},k)}R(p|\ell_{1},t)\Bigl{[}\left\lVert\hat\mathbf{{e}}_{1}+\mathbf{p}-\hat{\mathbf{e}}_{1}\right\rVert_{L_{2}}-\gamma_{1}\Bigr{]}_{+} \Biggr{\}} \tag{22}\] \[L_{EA-\text{CE}}(\ell_{1},\ell_{2})=\sum\limits_{(\ell_{1},\ell_{ 2})}\Bigl{[}\left\lVert\mathbf{e}_{2}+\mathbf{a}-f_{a}(\mathbf{v})\right\rVert_{L_{2}}- \gamma_{1}\Bigr{]}_{+}\] (23) \[L_{EA-\text{CE}}(\ell_{2},\ell_{1})=\sum\limits_{(\ell_{2},\ell_{ 2})}\Bigl{[}\left\lVert\hat{\mathbf{e}}_{1}+\mathbf{a}-f_{a}(\mathbf{v})\right\rVert_{L_{2 }}-\gamma_{1}\Bigr{]}_{+} \tag{24}\]