from gensim.models import word2vec
model = word2vec.Word2Vec.load_word2vec_format('/home/ubuntu/word2vec/PubMed-w2v.bin', binary=True)
model.save_word2vec_format('/home/ubuntu/word2vec/PubMed-w2v.txt', binary=False)
运行代码时提醒错误:
作为轻度强迫症的我,看到这个UserWarning 极为不爽快,于是就安装 Pattern, 也是各种安装不成功,网上搜索原因的时候发现:python2.x 才支持Pattern ,而我用的是python3.5.2, 不能因为个Warning退回Python2.x 于是我忍了。果然只是轻度强迫症
第二种方法(与第一种大同小异,不过也记录一下)
from gensim.models import word2vec
model = word2vec.Word2Vec.load_word2vec_format('Path/to/GoogleNews-vectors-negative300.bin', binary=True)
mo