python - setting up the model in gensim for GoogleNews -
the following model setup correctly text8 don't know else should write google news model make work correctly. here's code text8:
sentences = word2vec.text8corpus("text8") model = word2vec.word2vec(sentences) #model.init_sims(replace = true) model_name = "text8_data" model.save(model_name)
here's code google news:
model = gensim.models.word2vec.load_word2vec_format('googlenews-vectors-negative300.bin', binary=true) #model.init_sims(replace=true) model_name = "google_news" model.save(model_name)
my end goal calculating wmd distance on these models. else should add code google news able use wmd distance?
model.wmdistance(cleaned_f1_words, cleaned_f2_words)
Comments
Post a Comment