What’s Knowledge Graph Embedding?

Knowledge Graph (KG) is a directed, multi-relational, heterogeneous graph. It is composed of two components: entity and relation. Figure 1 depicts an exemplary KG.

In the graph, each node is an entity, and each edge is the relation.

From the vivid example of KG in Fig.1, We can understand the obscure definition of KG clearly:

  • directed: It is a directed graph obviously.

  • multi-relational: There are many different relations on the graph such as painted, is in, is interested in, etc.

  • heterogeneous: There are also have different types of entities, MONA LISA is an artwork, DA VINCI is a person, PARIS is a place, and so forth. An entity can be a concrete object like MONA LISA and LOUVRE, it can also be an abstract concept like Person and Place.

_images/kg.png

Figure 1: An exemplary Knowledge Graph

In general, we formulate a knowledge graph \(\mathcal{K} \subseteq \mathbb{K}=\mathcal{E} \times \mathcal{R} \times \mathcal{E}\), where \(\mathcal{E}\) and \(\mathcal{R}\) are set of entities and relations. \(\mathcal{K}\) comprise many trplets \((h,r,t) \in \mathcal{K}\) in which \(h,t \in \mathcal{E}\) represent a triplets’ head and tail respectively, and \(r \in \mathcal{R}\) represents its relationship.

For instance, the triplet \((\it{DA~VINCI},~\it{painted},~\it{MONA~LISA})\) in Fig.1, \(\it{DA~VINCI}\) is the head and \(\it{MONA~LISA}\) is the tail entity, there has a relation \(\it{painted}\) from head to tail.

Knowledge Graph Embedding Modle learn the latent representation of entities \(e \in \mathcal{E}\) and relations \(r \in \mathcal{R}\) in a Knowledge Graph \(\mathcal{K}\) that these laten representations preseve the structural infomation in KG.

Here we taxnomize the Knowledge Graph Embedding Models into two:

  • Translating-based Model

  • Semantic-based Model

Translating-based Model

In translating-based knowledge graph embedding models, the head entity is translated by relation to the tail entity:

\[trans_r(h) \approx predicate(t)\]

Here we repesent the lhs \(trans_r(h)\) as \(translation\), the rhs \(predicate(t)\) as \(predicate\).

Translating-based models use scoring function to measure the plausibility of a triplet, the scoring function can be distance-based such as Lp-distance or similarity-based such as dot prouct that measure the distance bewtween \(translation\) and \(predicate\).

Every translating-based model can be formulated in this frame, for example:

Model

\(translation\)

\(predicate\)

TransE

\(\textbf{e}_h + \textbf{r}_r\)

\(\textbf{e}_t\)

\({\textbf{e}_h}_{\perp} + \textbf{r}_r\)
\({\textbf{e}_h}_{\perp} = \textbf{e}_h - \textbf{w}_r^T \textbf{e}_h\textbf{w}_r\)
\({\textbf{e}_t}_{\perp}\)
\({\textbf{e}_t}_{\perp} = \textbf{e}_t - \textbf{w}_r^T \textbf{e}_t \textbf{w}_r\)
\({\textbf{e}_h}_{\perp} + \textbf{r}_r\)
\({\textbf{e}_h}_{\perp} = \textbf{e}_h \textbf{M}_r\)
\({\textbf{e}_t}_{\perp}\)
\({\textbf{e}_t}_{\perp} = \textbf{e}_t \textbf{M}_r\)

Semantic-based Model

Semantic-based Model measures plausibility of triplets by matching latent semantics of entities and relations in their laten vector representations. Each model difines how it measures the plausibility of triplets \(f(h,r,t)\), for example:

Model

\(f(h,r,t)\)

RESCAL

\(\textbf{e}_h^{T} \textbf{R}_{r} \textbf{e}_t\)

DistMult

\(\textbf{e}_h^{T} diag(\textbf{R}_{r}) \textbf{e}_t\)