gpt4 book ai didi

python-3.x - Gensim:KeyedVectors.train()

转载 作者:行者123 更新时间:2023-12-05 04:11:27 27 4
gpt4 key购买 nike

我从 here 下载维基百科词向量.我加载了向量:

model_160 = KeyedVectors.load_word2vec_format(wiki_160_path, binary=False)

然后想训练他们:

model_160.train()

我得到了错误:

---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-11-22a9f6312119> in <module>()
----> 1 model.train()

AttributeError: 'KeyedVectors' object has no attribute 'train'

我现在的问题是:KeyedVectors 似乎没有训练功能,但我想继续在我个人的句子上训练向量,而不是仅仅使用维基百科向量。这怎么可能?

提前致谢,简

最佳答案

您不能为此使用 KeyedVectors。来自 the documentation :

Word vector storage and similarity look-ups.
The word vectors are considered read-only in this class.

also :

The word vectors can also be instantiated from an existing file on disk in the word2vec C format as a KeyedVectors instance.
[...]
NOTE: It is impossible to continue training the vectors loaded from the C format because hidden weights, vocabulary frequency and the binary tree is missing.

关于python-3.x - Gensim:KeyedVectors.train(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42626287/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com