word2vec生成后缀名model文件处理
引入from gensim.models import word2vec
读取test02.model里面的词·
1 model = word2vec.Word2Vec.load('test02.model') 2 words = model.wv.vocab.keys() 3 words = list(words) 4 for i in words[0:10]: 5 print(i)
耐得住寂寞,才能登得顶
Gitee码云:https://gitee.com/lyc96/projects