sagorbrur/bnlp

Unable to get the vocabulary of Word2Vec in bwv = BengaliWord2Vec()

Closed this issue · 7 comments

I am Using bwv = BengaliWord2Vec(). But unable to get the vocabulary length.

Hi @hegdekasha,
You can get the vocab length by the following code
len(bwv.model.wv)

BengaliWord2Vec() contains the model as a class constructor variable. When you call bwv.model it will return the word2vec model just like the Gensim load model.

Hi @hegdekasha ,
You have to install fasttext separately by pip install fasttext==0.9.2
If you have a Linux-based OS it will work, but I am not sure about Windows or Mac. Last time I got an error in Windows.
This is the reason I made it separate and installable.

It will work then.
Install fasttext by pip install fasttext==0.9.2 and run your code again.

Cheers