-->

在Gensim WordRank曲面嵌入问题(Issues in Gensim WordRank E

2019-11-04 12:15发布

我使用Gensim包装获得wordRank的嵌入(我下面的教程要做到这一点),如下所示。

from gensim.models.wrappers import Wordrank

model = Wordrank.train(wr_path = "models", corpus_file="proc_brown_corp.txt", 
out_name= "wr_model")

model.save("wordrank")
model.save_word2vec_format("wordrank_in_word2vec.vec")

不过,我收到以下错误FileNotFoundError: [WinError 2] The system cannot find the file specified 。 我只是想知道我已经错了,因为一切看起来正确的给我。 请帮我。

此外,我想知道如果我保存模型的方式是正确的。 我看到Gensim提供的方法save_word2vec_format 。 什么是使用它,而无需直接使用原来的wordRank模型的优势在哪里?

Answer 1:

FileNotFoundError: [WinError 2] The system cannot find the file specified

所以,我要去这里假设你得到了回溯上

model = Wordrank.train(wr_path = "models", corpus_file="proc_brown_corp.txt", 
out_name= "wr_model")

你看,wr_path应该指向您安装wordrank在哪里,更具体,路径到您的wordrank二进制文件保存的文件夹。

所以,我的是path_to_wordrank_binary ='/home/ubuntu/wordrank'这里wordrank是包含wordrank.cpp的文件夹

然后确保你的语料库文件是当前目录。 因为这是你给什么。

这是你应该寻找到教程。



文章来源: Issues in Gensim WordRank Embeddings