from gensim.test.utils import common_texts, get_tmpfile
from gensim.models import Word2Vec

path = get_tmpfile("word2vec.model")
print(common_texts)

with open('output.txt') as f:
    train_texts = []
    for line in f:
        line_train = line.split(' ')
        train_texts.append(line_train)
    f.close()

model = Word2Vec(train_texts, size=200, window=5, min_count=5, workers=4)
model.save("word2vec.model")
model = Word2Vec.load("word2vec.model")

print(model.wv['数学'])
model.wv.save_word2vec_format('vocab.txt')
