# Coarse-to-Fine Entity Alignment for Chinese Heterogeneous Encyclopedia Knowledge Base
## 3 CFEA Model
### Fine-Grained Context Topicalization  
The effectiveness of simple attribute similarity-based matching is insufficient, especially in the case of missing and ambiguous information of attributes. However, most of the Chinese web encyclopedia websites have the problems of heterogeneity and ambiguity, such as the lack of attributes and the complicated interleaving of information. This causesdifficulties for the entity-matching problem based on attribute information only. Therefore, additional contextual information is needed to supplement it. Entities in an encyclopedic knowledge base site not only contain structured or semi-structured knowledge such as attribute tables but usually also contain texts of description and abstracts of the webpages to which it belongs. The description text describes the entity from different aspects, and the abstract provides a brief summary of the relevant webpages. We refer to the two together as the context information of an entity. Using the vast amount of unstructured contexts present in the knowledge base, we obtain the underlying semantics and relationships and construct entity features for deeper studies through complex probabilistic model building and statistical relationship learning. An essential feature is that the contexts for the same entity may differ across different knowledge bases, but their topics are similar. Therefore, to exclude the interference caused by textual differences, we perform LDA-based topic modeling of the context and apply it to fine-grained entity alignment. The similarity calculation of contexts using the LDA topic model includes the following steps:  
1. Data acquisition and pre-processing In this part, we obtained corpus from Baidu Baike and Hudong Baike. These corpora include abstracts and descriptions of encyclopedic entities. After that, we perform word splitting for Chinese and filter out the stopwords. We sorted out four stopword lists ([[https://github.com/goto456/stopwords](https://github.com/goto456/stopwords)]([https://github.com/goto456/stopwords](https://github.com/goto456/stopwords)) accessed on 17 December 2021), cn-stopwords, hit-stopwords, baidu-stopwords, and scu-stopwords from different companies or universities with our supplements. 2. Topic modeling and parameter estimation LDA modeling finds the topic distribution of each document and the word distribution of each topic. LDA assumes that the prior document-topic distribution is the Dirichlet distribution, that is, for any document \(d\), its topic distribution \(\theta_{d}\) is: \[\theta_{d}=Dirichlet(\vec{\alpha})\] (8) where \(\alpha\) is the hyperparameter of the distribution and is a \(K\)-dimensional vector, and \(K\) is an artificially pre-defined parameter for the number of topics. Furthermore, LDA assumes that the prior topic-word distribution is also the Dirichlet distribution, that is, for any topic \(k\), its word distribution \(\phi_{k}\) is: \[\phi_{k}=Dirichlet(\vec{\beta})\] (9) where \(\beta\) is the hyperparameter of the distribution and is a \(V\)-dimensional vector, and \(V\) is the number of words. Based on the Dirichlet distribution, we conduct topic modeling on the corpus after pre-processing. Then perform parameter estimation for topic model, that is, solve \(\theta_{d},\phi_{k}\) with Gibbs sampling [49]. After that, we can generate the topic feature with solved parameters. 3. Topic feature generation Topic-word matrix \(\phi_{k}\) is as follows. \[\phi_{k}= \begin{bmatrix}p_{11}&p_{12}&\cdots&p_{1v}\\ p_{21}&p_{22}&\cdots&p_{2v}\\ \vdots&\vdots&&\vdots\\ p_{k1}&p_{k2}&\cdots&p_{kv}\end{bmatrix} \] (10) where \(p_{ij}\) represents the probability of assigning the \(j\) th word to the \(i\) th topic, \(v\) is the total number of words, and \(k\) is the total number of topics. We take the \(m\) (\(m<v\)) words with the highest probability in each row of records \((p_{i1},p_{i2},\cdots,p_{ip})\) in the topic-word matrix \(\phi_{k}\).