getting error for len(bft.model.wv)
hegdekasha opened this issue · comments
Hai,
I wanted get the vocabulary size of BNLPfasttext model. I used similar code which worked for word2vec. However, it is not working for for fastext. could to please help me
Hi @hegdekasha ,
Here is the way to get the vocab size:
from bnlp.embedding.fasttext import BengaliFasttext
bft = BengaliFasttext()
print(len(bft.model.words))
You can check the inside module and get other method by the following steps:
from bnlp.embedding.fasttext import BengaliFasttext
bft = BengaliFasttext()
print(dir(bft))
# bft contains a module "model"
# then again you can check the inside module by
print(dir(bft.model))
# now you will get the other module inside bft.model and use accordingly
Hope it will help.
Regards
Thank you it is working
*Regards*
Asha Hegde
Research Scholar
Department of Computer Science
Mangalore University
…On Mon, Nov 6, 2023 at 1:35 PM Sagor Sarker ***@***.***> wrote:
Hi @hegdekasha <https://github.com/hegdekasha> ,
Here is the way to get the vocab size:
from bnlp.embedding.fasttext import BengaliFasttext
bft = BengaliFasttext()
print(len(bft.model.words))
You can check the inside module and get other method by the following
steps:
from bnlp.embedding.fasttext import BengaliFasttext
bft = BengaliFasttext()print(dir(bft))# bft contains a module "model"# then again you can check the inside module byprint(dir(bft.model))# now you will get the other module inside bft.model and use accordingly
Hope it will help.
Regards
—
Reply to this email directly, view it on GitHub
<#39 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AV2J63C6CODEAR3RVH6E6T3YDCK4DAVCNFSM6AAAAAA666SDJKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJUGI3DONRUGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>