# Coarse-to-Fine Entity Alignment for Chinese Heterogeneous Encyclopedia Knowledge Base
## 3 CFEA Model
### Middle-Grained Attribute Similarity  
The attributes of entities in the knowledge base are the fundamental information for the study of alignment. However, there are two types of problems with the attributes in the Chinese web encyclopedia: on the one hand, the heterogeneous encyclopedic knowledge base contains voluminous contents of subject areas and does not have complete ontological information; on the other hand, the web data of user-generated content (UGC) introduces the problem of ambiguity. For the former problem, the similarity-based approach allows distinguishing the entities in the encyclopedic knowledge base, especially those with more accurate attribute definitions. For the latter problem, we use an edit distance-based approach to calculate the similarity. The reason for this is that an edit distance-based approach can effectively deal with error sensitivity issues, such as entry errors. This is meaningful for web encyclopedia data that belongs to UGC. Therefore, we propose an attribute similarity calculation method suitable for encyclopedic knowledge bases based on the edit distance algorithm described in [34]. Figure 5: Examples of the preset attribute list. (**a**) is a category in a two-dimensional list, while (**b**) is a coarse category in a three-dimensional list. Each category corresponds to some attributes, which are called preset attributes. Set categories’ preset attributes are based on experience to distinguish the types of entities at multiple granularities. Specifically, the Levenshtein distance is a typical method of edit distance calculation that measures the similarity of strings. Edit distance is the minimum number of operations to convert the string \(str1\) to \(str2\). The operations for characters include insertion, deletion, and replacement. The smaller the distance, the more similar the two strings are. For two strings S1 and S2, the Levenshtein distance calculation formula [34] is as follows. \[\mathit{LevD}_{S1,S2}(i,j)=\left\{ \begin{matrix}i&,\text{if }j=0\\ j&,\text{if }i=0\\ \end{matrix} \right.\\ min\left\{ \begin{matrix}\mathit{LevD}_{S1,S2}(i-1,j)+1\\ \mathit{LevD}_{S1,S2}(i,j-1)+1\\ \mathit{LevD}_{S1,S2}(i-1,j-1)+1\end{matrix} \right\}&,\mathit{otherwise}\end{matrix} \tag{4}\]  
where \(S1[i]andS2[j]\) are the \(i\) th character of string S1 and the \(j\) th character of string S2, respectively. From the above, we apply edit distance to attribute name alignment and attribute value similarity calculation, respectively. Different knowledge bases vary not only in describing textual information and semi-structured attribute's values, but also in what attributes they contain and which attribute's names they call. The first use of edit distance-based similarity calculation in our CFEA model is to match the attribute's names of different entities, i.e., attribute alignment. Only attributes that reach a certain threshold will be matched for the next values alignment, otherwise they will be treated as invalid information. The second use of edit distance calculation is to perform a similarity calculation on the attribute values of the entity pairs to be matched. The detailed calculation is shown below. 1. Attributes of encyclopedia knowledge base **Definition 3**. : _After the preprocessing of the dataset, entity \(e_{a}\) has the set of attribute names, that is, \(Attribute_{a}=p_{a1},p_{a2},p_{a3},...,p_{am}\). The corresponding set of attribute values is \(Value_{a}=v_{a1},v_{a2},v_{a3},...,v_{am}\). Entity \(e_{b}\)'s set of attribute names is \(Attribute_{b}=p_{b1},p_{b2},p_{b3},...,p_{bm}\). Its set of attribute's values is \(Value_{b}=v_{b1},v_{b2},v_{b3},...,v_{bm}\). where \(m,n\) are the number of attributes of the entity \(e_{a},e_{b}\), respectively._
2. The conditions for matching attribute \(Attribute_{a}\) and \(Attribute_{b}\) \[\mathit{LevD}(p_{a},p_{b})>c\] (5) where \(p_{a}\) and \(p_{b}\) are the attribute's names from \(Attribute_{a}\) and \(Attribute_{b}\), respectively, and \(c\) is the minimum threshold for an attribute name to match. 3.