Link Prediction in Knowledge Graphs: A Hierarchy-Constrained Approach

Link prediction over a knowledge graph aims to predict the missing head entities <inline-formula><tex-math notation="LaTeX">$h$</tex-math><alternatives><mml:math><mml:mi>h</mml:mi></mml:math><inline-graphic xlink:href="li-ieq1-2867583.gif"/></alternatives></inline-formula> or tail entities <inline-formula><tex-math notation="LaTeX">$t$</tex-math><alternatives><mml:math><mml:mi>t</mml:mi></mml:math><inline-graphic xlink:href="li-ieq2-2867583.gif"/></alternatives></inline-formula> and missing relations <inline-formula><tex-math notation="LaTeX">$r$</tex-math><alternatives><mml:math><mml:mi>r</mml:mi></mml:math><inline-graphic xlink:href="li-ieq3-2867583.gif"/></alternatives></inline-formula> for a triple <inline-formula><tex-math notation="LaTeX">$(h,r,t)$</tex-math><alternatives><mml:math><mml:mrow><mml:mo>(</mml:mo><mml:mi>h</mml:mi><mml:mo>,</mml:mo><mml:mi>r</mml:mi><mml:mo>,</mml:mo><mml:mi>t</mml:mi><mml:mo>)</mml:mo></mml:mrow></mml:math><inline-graphic xlink:href="li-ieq4-2867583.gif"/></alternatives></inline-formula>. Recent years have witnessed great advance of knowledge graph embedding based link prediction methods, which represent entities and relations as elements of a continuous vector space. Most methods learn the embedding vectors by optimizing a margin-based loss function, where the margin is used to separate negative and positive triples in the loss function. The loss function utilizes the general structures of knowledge graphs, e.g., the vector of <inline-formula><tex-math notation="LaTeX">$r$</tex-math><alternatives><mml:math><mml:mi>r</mml:mi></mml:math><inline-graphic xlink:href="li-ieq5-2867583.gif"/></alternatives></inline-formula> is the translation of the vector of <inline-formula><tex-math notation="LaTeX">$h$</tex-math><alternatives><mml:math><mml:mi>h</mml:mi></mml:math><inline-graphic xlink:href="li-ieq6-2867583.gif"/></alternatives></inline-formula> and <inline-formula><tex-math notation="LaTeX">$t$</tex-math><alternatives><mml:math><mml:mi>t</mml:mi></mml:math><inline-graphic xlink:href="li-ieq7-2867583.gif"/></alternatives></inline-formula>, and the vector of <inline-formula><tex-math notation="LaTeX">$t$</tex-math><alternatives><mml:math><mml:mi>t</mml:mi></mml:math><inline-graphic xlink:href="li-ieq8-2867583.gif"/></alternatives></inline-formula> should be the nearest neighbor of the vector of <inline-formula><tex-math notation="LaTeX">$h+r$</tex-math><alternatives><mml:math><mml:mrow><mml:mi>h</mml:mi><mml:mo>+</mml:mo><mml:mi>r</mml:mi></mml:mrow></mml:math><inline-graphic xlink:href="li-ieq9-2867583.gif"/></alternatives></inline-formula>. However, there are many particular structures, and can be employed to promote the performance of link prediction. One typical structure in knowledge graphs is hierarchical structure, which existing methods have much unexplored. We argue that the hierarchical structures also contain rich inference patterns, and can further enhance the link prediction performance. In this paper, we propose a hierarchy-constrained link prediction method, called hTransM, on the basis of the translation-based knowledge graph embedding methods. It can adaptively determine the optimal margin by detecting the single-step and multi-step hierarchical structures. Moreover, we prove the effectiveness of hTransM theoretically, and experiments over three benchmark datasets and two sub-tasks of link prediction demonstrate the superiority of hTransM.