I use this code to load binary model, then save the model to text file,
from gensim.models.keyedvectors import KeyedVectors
model = KeyedVectors.load_word2vec_format('path/to/GoogleNews-vectors-negative300.bin', binary=True)
model.save_word2vec_format('path/to/GoogleNews-vectors-negative300.txt', binary=False)
References: API and nullege.
Note:
Above code is for new version of gensim. For previous version, I used this code:
from gensim.models import word2vec
model = word2vec.Word2Vec.load_word2vec_format('path/to/GoogleNews-vectors-negative300.bin', binary=True)
model.save_word2vec_format('path/to/GoogleNews-vectors-negative300.txt', binary=False)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…