piskvorky / gensim

Topic Modelling for Humans
https://radimrehurek.com/gensim
GNU Lesser General Public License v2.1
15.7k stars 4.38k forks source link

Getting a problem regarding glove #1975

Closed jayrodge closed 6 years ago

jayrodge commented 6 years ago

Description

I'm trying to implement Wordrank on a corpus, butting getting the following error.

from gensim.models.wrappers import Wordrank

wr_path = 'wordrank' # path to Wordrank directory
out_dir = 'model1' # name of output directory to save data to
data = 'test.cor' # sample corpus

model = Wordrank.train(wr_path, data, out_dir)

Getting this error

FileNotFoundError: [Errno 2] No such file or directory: 'wordrank/glove/vocab_count'

Please suggest any changes so that it executes. Thanks

menshikh-iv commented 6 years ago

Hello @jayrodge, check that wr_path is an absolute path & wordrank folder contains glove folder with several binaries like this

(qqq) ivan@P50:~/release/wordrank/glove$ pwd
/home/ivan/release/wordrank/glove
(qqq) ivan@P50:~/release/wordrank/glove$ ls -l
total 172
-rwxr-xr-x 1 ivan ivan 28432 авг 30  2017 cooccur
-rw-r--r-- 1 ivan ivan 19258 авг 30  2017 cooccur.c
-rwxr-xr-x 1 ivan ivan  1109 май  3  2014 demo.sh
drwxr-xr-x 3 ivan ivan  4096 авг  1  2014 eval
-rwxr-xr-x 1 ivan ivan 28368 авг 30  2017 glove
-rw-r--r-- 1 ivan ivan 15910 авг 30  2017 glove.c
-rw-r--r-- 1 ivan ivan 11358 авг 28  2014 LICENSE
-rw-r--r-- 1 ivan ivan   466 май  3  2014 makefile
-rw-r--r-- 1 ivan ivan  1728 авг 28  2014 README
-rwxr-xr-x 1 ivan ivan 19392 авг 30  2017 shuffle
-rw-r--r-- 1 ivan ivan  8107 авг 30  2017 shuffle.c
-rwxr-xr-x 1 ivan ivan 15160 авг 30  2017 vocab_count
-rw-r--r-- 1 ivan ivan  7443 авг 28  2014 vocab_count.c
(qqq) ivan@P50:~/release/wordrank/glove$