Coder Social home page Coder Social logo

Comments (5)

Ethan-yt avatar Ethan-yt commented on July 30, 2024

这是因为预训练使用的模型不同。由于BERT和RoBERTa的模型结构类似,所以他们的RoBERTA还是基于BERT模型训练的。而我们的训练方法是,直接使用RoBERTa模型训练,所以载入时也需要用RobertaModel。

from guwenbert.

renjunxiang avatar renjunxiang commented on July 30, 2024

这是因为预训练使用的模型不同。由于BERT和RoBERTa的模型结构类似,所以他们的RoBERTA还是基于BERT模型训练的。而我们的训练方法是,直接使用RoBERTa模型训练,所以载入时也需要用RobertaModel。

感谢您的回答。roberta和bert的差别应该只是在预训练过程中去掉了nsp和动态mask吧,模型结构应该是一样的。
如果是用HuggingFace脚本训练的,官方是已经去掉的NSP且MLM是动态的。我刚重新看了结构,区别只在token_type_embeddings,bert2个、roberta1个。因为token_type_embeddings在QA过程中的效果目前尚不明确,所以我觉得可以考虑用BertModel,否则在QA类型的任务会无法对query额外编码。
以上个人建议供参考哈~

from guwenbert.

Ethan-yt avatar Ethan-yt commented on July 30, 2024

@CZWin32768

from guwenbert.

CZWin32768 avatar CZWin32768 commented on July 30, 2024

Thanks for your interest @renjunxiang .
The type embedding is not a necessary component in pre-trained LMs (see the RoBERTa paper). The huggingface implementation reserves the type embedding just for compatibility.
You can directly concatenate the passage-query pair without type embedding for the QA task.

from guwenbert.

renjunxiang avatar renjunxiang commented on July 30, 2024

Thanks for your interest @renjunxiang .
The type embedding is not a necessary component in pre-trained LMs (see the RoBERTa paper). The huggingface implementation reserves the type embedding just for compatibility.
You can directly concatenate the passage-query pair without type embedding for the QA task.

Thank you for your answer!

from guwenbert.

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.