结合BERT和其他类型的嵌入

发布于 2025-01-30 12:08:20 字数 343 浏览 5 评论 0 原文

Flair模型可以给出任何单词的表示(它可以处理OOV问题),而BERT模型将未知的单词分为几个子字。

例如,“ hjik”一词将在Flair中代表一个向量,而在Bert中,它将分为几个单词(因为它是OOV),因此我们将为每个子单词都有几个向量。因此,从弗莱尔(Flair)那里,我们将有一个向量,而从伯特(Bert)我们可能有两个或多个向量。

这里的问题是 flairnlp 库库处理此问题?

注意:如果您不知道,您至少可以建议我一种适当的处理方法吗?

The flair model can give a representation of any word (it can handle the OOV problem), while the BERT model splits the unknown word into several sub-words.

For example, the word "hjik" will have one vector represented in flair, while in BERT it will be divided into several words (because it's OOV) and therefore we will have several vectors for each sub word. So from flair we'll have one vector while from BERT we might have two or more vectors.

The question here is how did the flairNLP library handle this issue?

NOTE:If you have no idea, can you at least suggest me a proper way to handle it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧城空念 2025-02-06 12:08:20

Transformerwordembeddings类的默认文字分为多个子字,您可以使用subtoken_pooling参数控制多个子字(您的选择是“ first”,“ first”,“ last”,“ first_last”和“ mean”),请参见此处的信息:

The TransformerWordEmbeddings class has default handling for words split into multiple subwords which you control with the subtoken_pooling parameter (your choices are "first", "last", "first_last" and "mean"), see the info here: https://github.com/flairNLP/flair/blob/master/resources/docs/embeddings/TRANSFORMER_EMBEDDINGS.md#pooling-operation

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文