Skip to content

Instantly share code, notes, and snippets.

@Everfighting
Created June 24, 2022 02:21
Show Gist options
  • Save Everfighting/a6f26750b419d1149f047a6b37673dea to your computer and use it in GitHub Desktop.
Save Everfighting/a6f26750b419d1149f047a6b37673dea to your computer and use it in GitHub Desktop.
import gensim.downloader as api
print(api.load('word2vec-google-news-300', return_path=True))
from gensim import models
word2vec_path = './word2vec-google-news-300.gz'
w2v_model = models.KeyedVectors.load_word2vec_format(word2vec_path, binary=True)
print(w2v_model["king"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment