# A Domain-Oriented Entity Alignment Approach Based on Filtering Multi-Type Graph Neural Networks
## 4 The Filtering Multi-Type Graph Neural Networks
### The Filtering Module  
The filtering module first employs a blocking mechanism to filter mismatched entities which are not deduplicated, and then utilizes a sub-knowledge graph generator to generate a set of sub-knowledge graphs. Figure 3 illustrates the filtering module in DomainEA. The blocking mechanism has shown a remarkable, outstanding performance in relational datasets [33] before the use of Multi-type Graph Neural Networks. The blocking mechanism designs a blocker to exclude the noisy entities, and to generate a candidate set for each entity in the original KGs. The sub-knowledge graph generator reconstructs the candidate sets of the entities into sub-knowledge graphs, which are the input of the embedding module.  
Recently, as representation learning has become popular, many works have applied it to entity alignment [34; 35; 36] in KGs. In contrast, the blocking step has received far less attention; only a few recent works have applied it to generate candidate sets [37; 38; 39; 40]. If we embed two heterogeneous knowledge graphs directly without a blocker in our approach, there are a large amount of entities that would need to be matched and would result in introducing noise. Moreover, directly computing all the entity embeddings of two heterogeneous knowledge graphs could take a lot of time in the subsequent calculation process; a considerable amount of the time spent would be unnecessary, which could reduce the efficiency of the entire model. Although the composition of the same entity in heterogeneous KGs is not identical, the same attributes may still exist for the same entity. In our work, we divide the attributes of an entity into single-value attributes and multi-values attributes. In addition to multi-values, such as the ingredients, each dish also has some single-value attributes, such as cooking techniques and taste. However, these single-value attributes are unsuitable for the embedding of a SA and an AA, but they can construct a well-performing blocking mechanism that excludes noisy entities and generates candidate sets for the embedding module. The blocking mechanism not only simplifies the calculation process, but also eliminates mismatched entities in advance, and enhances the final entity alignment.  
Figure 3: An example of the filtering module. \(C_{m}\) represents the candidate set for the \(m\)-th entity. \(KG_{m1}\) represents the sub-KG reconstructed by entities from the original \(KG_{1}\) in the \(m\)-th candidate set.  
For the recipe, we build the blocking mechanism with attribute-specific semantics of the entities in the KGs. These attribute-specific semantics are derived by analyzing the single-value attributes of the entities, such as cooking techniques, taste, and cooking difficulty. We first concatenate all the single-value attribute values of each entity in the KGs into a string. For example, in Figure 3, all the single-value attribute values of \(e_{11}\) consist of \(A_{11}\), \(A_{21}\), and \(A_{31}\). We contact \(A_{11}\), \(A_{21}\), and \(A_{31}\) into a concatenated string, which is fed into the pre-trained word embedding. The blocking mechanism consists of the pre-trained word embedding, the tuple embedding, and the cosine pairing, as shown in Figure 3. The pre-trained word embedding employs fastText to generate a high-dimensional vector representation of each word in the concatenated string. Subsequently, the tuple embedding aggregates these vectors into two vector sets, denoted as \(\mathbf{S}\) and \(\mathbf{T}\), in which each embedding has the same dimension and represents the concatenated string. The cosine- pairing module selects the top-K nearest neighbors by calculating the similarity \(Q(\mathbf{S},\mathbf{T})\), and generates candidate sets, C, for the embedding module.