Knowledge Graph Embedding by Translating on Hyperplanes
0. 问题
- TransE 无法解决 Reflexive, 1-N, N-1, N-N 等关系
- TransE 中构造负三元组样本的方式是随机替换三元组中的 h h h或 t t t, 由于知识图谱不可能包含所有的知识, 可能会构造出正确的三元组, 却把它当作负样本来处理, 引入假阴性的标签
1. 总结
- 提出一种基于翻译的模型 TransH, 将 r e l a t i o n relation relation 看作是在低维空间中由 h e a d head head 到 t a i l tail tail 在某个超平面上的一种翻译
- 提出了一种构造负三元组样本的方法, 为每种替换设置不同的概率. 使得 1 − n 1-n 1−n 关系中 “替换掉h” 和 n − 1 n-1 n−1 关系中 “替换掉t” 有着更大的概率.
2. 主要思想
- 每个 r e l a t i o n relation relation 由超平面的法向量 w r \mathbf{w}_{r} wr 和该超平面上的翻译向量 d r \mathbf{d}_{r} dr 表示. 约束 h \mathbf{h} h 和 t \mathbf{t} t 在该超平面上的投影 h ⊥ \mathbf{h}_{\perp} h⊥ 和 t ⊥ \mathbf{t}_{\perp} t⊥ 满足 h ⊥ + d r = t ⊥ \mathbf{h}_{\perp} + \mathbf{d}_{r} = \mathbf{t}_{\perp} h⊥+dr=t⊥ .
3. TransH 方法
约束 ∥ w r ∥ 2 = 1 \left\|\mathbf{w}_{r}\right\|_{2}=1 ∥wr∥2=1, 可得
h ⊥ = h − w r h w r t ⊥ = t − w r t w r \begin{aligned} \mathbf{h}_{\perp} &=\mathbf{h}-\mathbf{w}_{r} \mathbf{h} \mathbf{w}_{r} \\ \mathbf{t}_{\perp} &=\mathbf{t}-\mathbf{w}_{r} \mathbf{t} \mathbf{w}_{r} \end{aligned} h⊥t⊥=h−wrhwr=t−