## 3 Proposed Model
### Question Reasoning
#### 3.4.2 Path Selection and Similarity Calculation  
For reasoning, the HBHR model employs beam search rather than typical breadth-first search, which reduces the search space while raising the hit rate of accurate answers. The model internally builds a list \(B\) of capacity \(K\), denoted by _Top-K List_ in Figure 5, for recording the \(K\) paths that are currently most similar to the question, and then sorts the paths in descending order of similarity to the question. The model is initialized with \(B\) empty, and the set \(D=\{p_{1},p_{2},\ldots,p_{n}\}\) created by all paths from topic entity \(e_{t}\) with a one-hop distance is chosen, and each path \(p_{i}\) in \(D\) is encoded using the path embedding model to obtain the vector representation of the path \(\mathbf{e}_{i}^{p}\). The similarity between \(\mathbf{e}_{i}^{p}\) and \(\mathbf{e}^{q}\) is calculated below using the cosine similarity function, as shown in Equation (15):  
\[\cos\left(\mathbf{e}_{i}^{p},\mathbf{e}^{q}\right)=\frac{\mathbf{e}_{i}^{p} \bullet\mathbf{e}^{q}}{\left|\mathbf{e}_{i}^{p}\right|\times\left|\mathbf{e}^ {q}\right|} \tag{15}\]  
The outcome is then entered into \(B\). If the number of paths in \(B\) exceeds \(K\), the path with the least similarity, which is the last in the list, is deleted. After traversing all the paths in \(D\), we can obtain the \(K\) paths with the highest similarity to the question starting from \(e_{t}\).  
The model generates a temporal snapshot \(B_{1}\) during the second round of path selection. At this time, \(B_{1}\) contains \(K\) paths \(D=\{p_{1},p_{2},\ldots,p_{K}\}\) that are most likely to be the correct answer. For each of these paths \(p_{i}\), we select the next hop of its tail node \(pi.endNode\) that has not yet been visited as a new node to extend the path to form a new set of paths \(D_{i}=\{p_{i1},p_{i2},\ldots,p_{ik}\}\). Following that, we continue to encode each path \(p_{ij}\) in \(D_{i}\) using the path embedding model to obtain \(\mathbf{e}_{ij}^{p}\), calculate the similarity between \(\mathbf{e}_{ij}^{p}\) and \(\mathbf{e}^{q}\), and place it in list \(B\). If \(B\) overflows, the first \(K\) paths are still recorded in the order of highest to lowest similarity. When the above operation is performed for all paths in \(B\), i.e., after the 2 nd round of path selection is completed, compare the paths in list \(B\) with those in \(B_{1}\); if they are different, it means there are new candidate paths generated and continue the 3 rd round of path selection; if they are the same, it means there are no new paths generated in this round of path selection, end the path selection, and take the path with the highest similarity as the correct path \(\mathcal{P}\).  
After the model has generated \(\mathcal{P}\) through \(S_{E}\) and \(e_{t}\), the constraint information needs to be bound to \(\mathcal{P}\). The constraint extraction in Section 3.3 begins with obtaining the question's word vector matrix \(\mathbf{E}_{CD}\) using Bert, and ends with determining the constrained object \(O\). We generate the vector representation \(\mathbf{e}_{s}\) of \(O\) by summing and averaging the word vector matrix \(\mathbf{E}_{CD}^{O}\) representing \(O\) from the \(\mathbf{E}_{CD}\). \(\mathcal{P}\) is represented by a set consisting of \((head,relation,tail)\). The path embedding module's initial phase will encode \(\mathcal{P}\) using Bert, and all of the \((head,tail)\) vectors in it will be extracted independently to generate \(\mathbf{E}_{O}=\left[\mathbf{e}_{1}^{O},\mathbf{e}_{2}^{O},\cdots,\mathbf{e}_{ K}^{O}\right]\). Next, the similarity between \(\mathbf{e}_{s}\) and each vector in \(\mathbf{E}_{O}\) is calculated using cosine similarity, and the node with the highest similarity is selected as the bound node for the constraint. This part does not require any training.