Unable to get the vocabulary of Word2Vec in bwv = BengaliWord2Vec()
Closed this issue · 7 comments
hegdekasha commented
I am Using bwv = BengaliWord2Vec(). But unable to get the vocabulary length.
sagorbrur commented
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.
hegdekasha commented
Thank you so much. You made my day. Thank you
*Regards*
Asha Hegde
Research Scholar
Department of Computer Science
Mangalore University
…On Thu, Nov 2, 2023 at 7:54 PM Sagor Sarker ***@***.***> wrote:
Hi @hegdekasha <https://github.com/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.
—
Reply to this email directly, view it on GitHub
<#37 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV2J63F57FM56BKUZE4CT43YCOUITAVCNFSM6AAAAAA626GWBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJQHAZTKMRRGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
hegdekasha commented
I am having one more issue in loading bft = BengaliFasttext(). I am getting
error like " NameError: name 'fasttext' is not defined" Could help me
please to resolve this?
*Regards*
Asha Hegde
Research Scholar
Department of Computer Science
Mangalore University
…On Thu, Nov 2, 2023 at 8:04 PM Asha Hegde ***@***.***> wrote:
Thank you so much. You made my day. Thank you
*Regards*
Asha Hegde
Research Scholar
Department of Computer Science
Mangalore University
On Thu, Nov 2, 2023 at 7:54 PM Sagor Sarker ***@***.***>
wrote:
> Hi @hegdekasha <https://github.com/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.
>
> —
> Reply to this email directly, view it on GitHub
> <#37 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AV2J63F57FM56BKUZE4CT43YCOUITAVCNFSM6AAAAAA626GWBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJQHAZTKMRRGY>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
sagorbrur commented
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.
hegdekasha commented
I am using in Google colab.
…On Thu, Nov 2, 2023, 20:14 Sagor Sarker ***@***.***> wrote:
Hi @hegdekasha <https://github.com/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.
—
Reply to this email directly, view it on GitHub
<#37 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV2J63CVMOAZS7EVEFUKE2DYCOWWTAVCNFSM6AAAAAA626GWBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJQHA3TENBVGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
sagorbrur commented
It will work then.
Install fasttext by pip install fasttext==0.9.2
and run your code again.
Cheers
hegdekasha commented
Ok thank you.i will check
…On Thu, Nov 2, 2023, 21:02 Sagor Sarker ***@***.***> wrote:
It will work then.
Install fasttext by pip install fasttext==0.9.2 and run your code again.
Cheers
—
Reply to this email directly, view it on GitHub
<#37 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV2J63DLZOQABWC7BSXDZJTYCO4JVAVCNFSM6AAAAAA626GWBWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJQHE3DMMBRGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>