# A Domain-Oriented Entity Alignment Approach Based on Filtering Multi-Type Graph Neural Networks
## 4 The Filtering Multi-Type Graph Neural Networks
### The Embedding Module
#### 4.2.2 The Attribute-Aware Entity Embedding  
The existing methods only employ attribute names in attribute embedding, but overlook attribute values and the weights of the attribute values. Domain knowledge graphs, especially of recipes, encompass a large number of attribute values that describe entities with rich details. In addition, some attributes play a non-trivial role among the attributes of entities. For example, the dish \"tomato scrambled eggs\" is mainly composed of tomatoes and eggs, not salt. An AA is proposed to generate attribute-aware embeddings of the entities via their attribute values and attribute weights. The AA employs the attention mechanism and assigns appropriate weights to entity relationships based on the influence of adjacent entity features on the current entity. The AA requires paired adjacent entities during training, and we utilize a multi-headed AA to improve the generalization expression ability.  
The computational process of the AA can be decomposed into two parts. The first part is to calculate the normalized attention coefficient of the entities. To obtain the normalized attention coefficient of the \(j\)-th neighboring entity, we first compute the attention coefficient according to Equation (6). Subsequently, we employ softmax to normalize the result, as shown in Equation (7).  
In Equation (6), we first employ the weight matrix, \(\mathbf{W}\), to perform a linear transformation on the features of entities \(h_{i}\) and \(h_{j}\), and then concatenate the transformed result. This process can map the original features onto a higher-dimensional feature space, which facilitates the capture of intricate inter-entity relationships. Next, we utilize the attention weight vector, \(a^{\mathrm{T}}\), to assign the adaptive weight for different features via computing the scalar product with the concatenated result. Finally, we apply the LeakyReLu activation function to the computed result to obtain the final attention score, \(e_{ij}\).  
\[e_{ij}=LeakyReLu\left(a^{\mathrm{T}}\big{[}\mathbf{W}h_{i}\big{|}\big{|}\mathbf{W}h_{j }\big{]}\right) \tag{6}\]  
\[a_{ij}=softmax_{j}\big{(}e_{ij}\big{)}=\frac{\exp\big{(}e_{ij}\big{)}}{\sum_{ k\in N_{i}}\exp(e_{ik})},\hskip 28.452756 ptj,\ keN_{i} \tag{7}\]  
The second part aggregates the attention and characteristics of neighboring entities, and achieves the comprehensive attribute-aware embeddings of the entities. The comprehensive attribute-aware embedding of the \(i\)-th entity denoted as \(h_{i}^{\prime}\), is calculated as Equation (8).  
\[h_{i}^{\prime}=\sigma\Big{(}\sum_{j\in N_{i}}a_{ij}\mathbf{W}h_{j}\Big{)} \tag{8}\]  
In order to comprehensively and diversely capture the representation of KGs, our approach utilizes a multi-headed AA to capture the features of the entities from various subspaces. In particular, each attention head independently learns its own attention weights and generates corresponding feature vectors. K represents the number of heads of the AA in Equation (9).  
\[\mathrm{h}_{i}^{\prime}(K)=\sigma\Bigg{(}\frac{1}{K}\sum_{k=1}^{K}\sum_{j\in N _{i}}a_{ij}^{k}\mathbf{W}^{k}h_{j}\Bigg{)} \tag{9}\]