How is it possible to retrieve the n most frequent words from a Gensim word2vec
model? As I understand, the frequency and count are not the same, and I therefore can't use the object.count()
method.
I need to produce a list of the n most frequent words from my word2vec
model.
Edit:
I've tried the following:
w2c = dict()
for item in model.wv.vocab:
w2c[item]=model.wv.vocab[item].count
w2cSorted=dict(sorted(w2c.items(), key=lambda x: x[1],reverse=True))
w2cSortedList = list(w2cSorted.keys())
My initial guess was to use code above, but this implements the count method. I'm not sure if this represents the most frequent words.