Code Monkey home page Code Monkey logo

Comments (2)

zxlzr avatar zxlzr commented on June 10, 2024 1

感谢关注哈,前段时间忙发现这个issue,不知道是否已有同学回复了。我来简单解答一下问题:
1 在设计 KE loss 的时候是怎样考虑的?当时在实验的时候,KE loss 的表现又是如何?
答:设计KE主要为了隐式建立实体和关系间的一种关联,原理和之前一些知识增强提示学习的**是类似的,我们的确参考了transe。KE loss是有超参数控制的起到一种类似正则的作用,对模型影响较大的是同时学习verbalizer和prompt的embedding这一过程。对于少样本实验,方差会较大,需要run多次进行调参。
2负样本的选取中,是在 max_token_length 长度上选取的,必定也会包含 prompt 部分和 句子后面 padding 部分的 token,这个当时有没有考虑呢?
答: 这部分未做特殊处理,不过个人经验padding部分影响不大。
3 负样本的计算为什么会选用 real_relation_embedding,而不是选择模型的输出呢?
答:模型设计是为了学习更好的prompt 和verbalizer,这里real_relation_embedding表示了可学习的verbalizer,而且这个emb是有初始化向量的(关系标签词),用模型输出开始学习的时候很难保证能采样到符合要求语义的样本。

from knowprompt.

xerrors avatar xerrors commented on June 10, 2024

但是直接使用 $(s + r - o)$ 的方式,感觉是有点简单粗暴了哈~

这部分我后来做了些功课,这里计算使用的 $d(s, r, o) = (s+r-o)^2$ 兴许是参考了 TransE 中的做法?”在TransE中,关系类被表征为翻译嵌入式表征。如果实体对存在,则头实体与之对应的关系向量之和和尾实体尽可能相同。“

https://github.com/thunlp/KB2E/blob/master/TransE/Test_TransE.cpp#L98-L108

Translating Embeddings for Modeling Multi-relational Data

公式

from knowprompt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.