Created
February 6, 2019 14:50
-
-
Save infinityfuture/645ee25d27ea5ded2ca3203bc7e778ba to your computer and use it in GitHub Desktop.
Using Gensim train FastText Chinese Char vector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
from gensim.models.fasttext import FastText | |
# [ ['你', '好', '吗'] ] | |
sentences = pickle.load(open('./x.pkl', 'rb')) | |
model = FastText(size=64, window=10, min_count=1) | |
model.build_vocab(sentences=sentences) | |
model.train(sentences=sentences, total_examples=len(sentences), epochs=10) | |
model.wv.save_word2vec_format('./fasttext64.txt') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment