CS224W-Machine Learning with Graph- Knowledge Graph

Knowledge Graph Embeddings

Heterogeneous graphs: a graph with multiple relation types.

Knowledge in graph from: capture entities, types, and relationships

KG Example\text{KG Example}

Bibiographic Networks

Bio Knowledge Graphs

Applications of Knowledge Graphs

Knowledge Graph Dataset

Knowledge Graph Completion

KG Representation

Knowledge Graph Completion: TransE

TransE : How to learn?

Relations in a heterogeneous KG have different properties:

Four Relation Patterns

r(h,t)r(t,h) (r(h,t)¬r(t,h)) h,tr(h,t) \Longrightarrow r(t,h) \ (r(h,t)\Longrightarrow \neg r(t,h)) \ \forall h,t
r2(h,t)r1(t,h)r_2(h,t) \Longrightarrow r_1(t,h)
r1(x,y)r2(y,z)r3(x,z) x,y,zr_1(x,y) \land r_2(y,z) \Longrightarrow r_3(x,z) \ \forall x,y,z
r(h,t1),r(h,t2),,r(h,tn)r(h,t_1),r(h,t_2),\cdots,r(h,t_n)

are all True.

Antisymmetric Relations in TransE

r(h,t)¬r(t,h) h,tr(h,t) \Longrightarrow \neg r(t,h) \ \forall h,t

Inverse Relations in TransE

r2(h,t)r1(t,h)r_2(h,t) \Longrightarrow r_1(t,h)

Composition in TransE

r1(x,y)r2(y,z)r3(x,z) x,y,zr_1(x,y) \land r_2(y,z) \Longrightarrow r_3(x,z) \ \forall x,y,z

Symmetric Relation: Limitation

r(h,t)r(t,h) h,tr(h,t) \Longrightarrow r(t,h) \ \forall h,t

1-to-N Relations: Limitation

Knowledge Graph Completion: TransR

TransR

Symmetric Relations in TransR

r=0,h=Mrh=Mrt=t\textbf{r} =0, \textbf{h}_{\perp} = \textbf{M}_r\textbf{h} = \textbf{M}_r \textbf{t} = \textbf{t}_{\perp}

Antisymmetric Relations in TransR

r0,Mrh+r=Mrt,Mrt+rMrh\begin{align*} \textbf{r}\neq 0 , \textbf{M}_r\textbf{h} + \textbf{r} &= \textbf{M}_r\textbf{t}, \\ \Longrightarrow \textbf{M}_r\textbf{t} + \textbf{r} &\neq \textbf{M}_r \textbf{h} \end{align*}

1-to-N Relations in TransR

Inverse Relations in TransR

r2=r1,Mr1=Mr2\textbf{r}_2 = - \textbf{r}_1, \textbf{M}_{r_1} = \textbf{M}_{r_2}

then

Mr1t+r1=Mr1h\textbf{M}_{r_1} \textbf{t} + \textbf{r}_1 = \textbf{M}_{r_1} \textbf{h}

and

Mr2h+r2=Mr2t\textbf{M}_{r_2} \textbf{h} + \textbf{r}_2 = \textbf{M}_{r_2}\textbf{t}

Composition Relations in TransR

Knowledge Graph Completion: DistMult

New Idea: Bilinear Modeling

New Idea: Bilinear Modeling

fr(h,t)=<h,r,t>=ihrritif_r(h,t) = <h,r,t> = \sum_{i}h_r\cdot r_i \cdot t_i

1-to-N Relations in DistMult

Symmetric Relations in DistMult

fr(h,t)=<h,r,t>=ihiriti=<t,r,h>=fr(t,h)f_r(h,t) = <h,r,t> = \sum_{i} h_i \cdot r_i \cdot t_i = <t,r,h> = f_r(t,h)

Limitation: Antisymmetric Relations

fr(h,t)=<h,r,t>=<t,r,h>=fr(t,h)f_r(h,t) = <h,r,t> = <t,r,h> = f_r(t,h)

Limitation: Inverse Relations

Limitation: Composition Relations

Knowledge Graph Completion: ComplEx

fr(h,t)=Re(ihiriti)=<Re(hi),Re(ri),Re(ti)>+<Re(hi),Im(ri),Im(ti)>+<Im(hi),Re(ri),Im(ti)><Im(hi),Im(ri),Re(ti)>\begin{align*} f_r(h,t) &= Re(\sum_i h_i \cdot r_i \cdot \overline{t}_i) \\ & = <Re(h_i),Re(r_i),Re(t_i)> + <Re(h_i),Im(r_i),Im(t_i)> \\ &+<Im(h_i),Re(r_i),Im(t_i)> - <Im(h_i),Im(r_i),Re(t_i)> \end{align*}

Antisymmetric Relations in ComplEx

Symmetric Relations in ComplEx

Inverser Relations in ComplEX

Composition and 1-to-N in ComplEx