zjunlp / KnowPrompt

[WWW 2022] KnowPrompt: Knowledge-aware Prompt-tuning with Synergistic Optimization for Relation Extraction
MIT License
194 stars 34 forks source link

How to initialize the learnable relation embedding? #8

Closed chenhaishun closed 2 years ago

chenhaishun commented 2 years ago

在阅读本篇优秀论文的一些疑问:

期待作者们的回复!非常感谢!

njcx-ai commented 2 years ago

您好:

  1. 是的
  2. 该虚拟的word embedding of answer word 就是由问题1中的关系y的初始化得到
  3. Figure 2 (b) 中的[MASK]处得到的当前instance关系的向量表征,其与relation embedding(即virtual answer word 的表征)向量内积就是相似度啊,以此判断当前instance属于哪个类别。
chenhaishun commented 2 years ago

好的 非常感谢您的回复 @njcx-ai

chenhaishun commented 2 years ago

再次打搅,请问论文中“we expand the MLM Head layer of L with extra learnable relation embeddings as the virtual answer word sets V' "应当怎么理解呢?

njcx-ai commented 2 years ago

假设BERT的MLM Head对应15000个词汇表embedding (Ps: MLM head 最后一层的权重就是词汇表embedding,可自行查阅huggingface 代码),我们在此基础上扩展N个作为virtual answer word的embedding。

chenhaishun commented 2 years ago

明白了 再次感谢您的回复 @njcx-ai