You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
The data was in a form of a list of lists of strings or a list of sentences, where a sentence is a list of words.
Then we useWord2Vec class fromgensim
# time to try gensim to create word2vecs# see NLP in action, 6.2.4fromgensim.models.word2vecimportWord2Vecnum_features=50min_word_count=30num_workers=2window_size=20subsampling=1e-3model=Word2Vec(new_data,workers=num_workers,vector_size=num_features,min_count=min_word_count,window=window_size,sample=subsampling)model.init_sims(replace=True)me_w2v_model="me_word_embeddings_model.bin"model.save(me_w2v_model)
The model is now saved in the fileme_word_embeddings_model.bin.