K-BERT: Enabling Language Representation with Knowledge Graph.
对于每个句子抽取出三元组 ,构建sentence tree ,与原始句子合并一起编码position,输入给transformer。
对于position embedding,树上每个节点有个绝对位置hard position,每条路径分支上有soft position。具体如下图。
对于visible matrix。各个句子part只可见和自己有关的部分,无关的部分不可见。
KnowBERT:Knowledge Enhanced Contextual Word Representations. (EMNLP 2019)
将预训练得到的模型表示,经过知识提取后的知识表示得到基于实体的表示,再和原表示一起得到最终的表示。