# Coarse-to-Fine Entity Alignment for Chinese Heterogeneous Encyclopedia Knowledge Base
## 3 CFEA Model
### Coarse-Grained Blocking Algorithm  
For instance, the search for the keyword \"Milan\" in Chinese on the website of Baidu Baike yields 21 meanings. As in Figure 4, the diagram shows some of the meanings, such as a city in Italy, the Milan soccer club, and an orchid plant. These meanings can be classified as city names, names of people, names of books or films, names of plants, names of sports clubs, etc. When the current entity named \"Milan\" is judged by its attributes to be a person's name rather than a city's name or something else, we only need to look for candidates among the category of person entities. As a result, the number of candidate entities is significantly reduced from 21 to a single-digit number.  
Figure 3: Framework of the CFEA model.  
```
Input: dataset \(E_{A}\),\(E_{B}\), weight \(a\), thresholds \(c\), \(u\), \(v\), \(\omega\), number of topics \(K\) Output: result of entity alignment \(AE\)
1 foreachentity \(e\in(E_{A}\cup E_{B})\)do
2 build LDA model;
3 compute topics-words matrix \(\phi\) and documents-topics matrix \(\theta\) ;
4 compute \(e_{type}\) and partition ;
5
6 end fore
7 for\(i\gets 1\) to \(size(E_{A})\)do
8 for\(j\gets 1\) to \(size(E_{B})\)do
9 if\(i,j\) in same partition then
10 compute propertySim=EditDist(\(e_{i},e_{j}\)) ;
11 // by edit distance-based similarity
12 ifpropertySim=threshold\(u\)then
13\(AE\gets AE\cup\{(e_{i},e_{j})\}\);
14
15 elseifpropertySim=cltrlschild\(v\)then
16 continue;
17
18 else
19 compute contextSim=LDASim(\(e_{i},e_{j}\)) ;
20 // by LDA topic features similarity
21 ifcontextSim=threshold\(\omega\)then
22\(AE\gets AE\cup\{(e_{i},e_{j})\}\);
23
24 end if
25
26 end for
```  
**Algorithm 1**Coarse-to-fine entity alignment algorithm  
In the field of database technology, the method of pre-processing before entity matching is called \"blocking and index techniques\" [48]. Blocking and index techniques assign entities with certain similar characteristics to the same block, so that entity matching is done only within the same block. This technique, which comes from the database domain, can be applied to the entity alignment for the knowledge base.  
Figure 4: An example of the entity “Milan” in Baidu Baike. The multiple meanings of Milan are displayed in the rightmost column in the figure. These meanings can be divided into several categories, which are shown in the middle of the figure.  
Our method requires setting a \"preset attribute list\". As shown in Figure 5a, it is a two-dimensional list, in which the first dimension contains several categories that we include in the reference and the second dimension contains some names of feature attributes we set for that category.  
The preset attribute list is versatile and flexible for blocking the encyclopedic knowledge base, which usually contains many kinds of entities. Based on the official category indexes of several encyclopedia sites, and removing categories with little difference or containment-inclusion relationships, we get the preset attribute list after collating them. This is generally applicable to other Chinese encyclopedic knowledge bases as well.  
In addition, the list can be extended somewhat to improve the efficiency and accuracy of blocking. If the two-dimensional list is extended to a multi-dimensional list, i.e., there are small categories in a large classification, and the scope and accuracy of the classification is flexibly controlled at multiple levels. Figure 5b is an example of coarse-grained category in a three-dimensional list. It allows more flexibility to control whether the matching range is coarse or fine, and whether the entity matching speed is fast or slow, and to find a balance when performing matching between entities.