SPACY - 对词向量和 tok2vec 的混淆

SPACY - Confusion about word vectors and tok2vec

如果你能帮助我理解一些关于 Spacy 的基本概念,那将对我很有帮助。

我知道一些 spacy 模型有一些预定义的静态向量,例如,对于西班牙语模型,这些是 FastText 生成的向量。 我还了解到有一个 tok2vec 层可以从标记生成向量,例如用作模型 NER 组件的输入。

如果以上是正确的,那么我有一些问题:

非常感谢!

Does the NER component also use the static vectors?

这在我的回答的第 2 点和第 3 点中得到解决

Is the tok2vec layer already trained for pretrained downloaded models, e.g. Spanish?

是的,整个模型都训练好了,tok2vec层是其中的一部分。

If I replace the NER component of a pretrained model, does it keep the tok2vec layer untouched i.e. with the learned weights?

不,不在当前的 spaCy v2 中。 tok2vec 层是模型的一部分,如果删除模型,也会删除 tok2vec 层。在即将推出的 v3 中,您将能够将它们分开,这样您实际上可以单独保留 tok2vec 模型,并在组件之间共享它。

Is the tok2vec layer also trained when I train a NER model?

是 - 见上文

Would the pretrain command help the tok2vec layer learn some domain-specific words that may be OOV?

另请参阅我在

的回答

如果您还有其他问题 - 很高兴在评论中讨论!