Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to initialize the learnable relation embedding? #8

Closed
chenhaishun opened this issue Jul 6, 2022 · 5 comments
Closed

How to initialize the learnable relation embedding? #8

chenhaishun opened this issue Jul 6, 2022 · 5 comments

Comments

@chenhaishun
Copy link

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

  • 在Relation Knowledge Injection这一小节提到要将关系的语义知识注入到关系的初始化向量中,请问是通过对某一关系中的单词频率来对embedding进行加权的吗?例如有关系 y = per:countries_of_residence,那么其候选集单词为{"person", "country", "residence“},其概率分布为{“1/3”,“1/3”,“1/3”},所以关系y的初始化是 y_initialized_embedding = 1/3 person_embedding + 1/3 country_embedding + 1/3 residence_embedding吗?
  • 同样是这一小节中假设在一个已知 PLM 的 vocabulary 中存在一个隐式的虚拟 answer word 来表示关系标签(例如问题1中的y),请问该虚拟的word embedding如何计算得到?和问题1中的关系y的初始化是什么关系呢?
  • 请问 Figure 2 (b) 中的[MASK]处得到的是[MASK]在虚拟的answer words V'的概率分布吗?其结果和relation embedding head的输出进行叉乘表示的是什么呢?(relation embedding head 表示的是问题1中的初始化关系吗?)

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

@njcx-ai
Copy link
Contributor

njcx-ai commented Jul 7, 2022

您好:

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

@chenhaishun
Copy link
Author

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

@chenhaishun
Copy link
Author

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

@chenhaishun chenhaishun reopened this Jul 7, 2022
@njcx-ai
Copy link
Contributor

njcx-ai commented Jul 7, 2022

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

@chenhaishun
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants