After training a word2vec model using python gensim, how do you find the number of words in the model's vocabulary?

918    Asked by JoaquinaMesser in Data Science , Asked on Dec 23, 2019
Answered by Joaquina Messer

Using gensim, we can get the number of words using. vocab field of the Word2Vec model's wv property, as a dictionary, with the keys being each token. The snippet code for the same is given below


One more way is to embed the matrix itself to get the size



Your Answer

Interviews

Parent Categories