SpaCy: how to load Google news word2vec vectors?

后端 未结 4 1646
面向向阳花
面向向阳花 2020-12-25 13:48

I\'ve tried several methods of loading the google news word2vec vectors (https://code.google.com/archive/p/word2vec/):

en_nlp = spacy.load(\'en\',vector=Fals         


        
4条回答
  •  粉色の甜心
    2020-12-25 14:20

    it is much easier to use the gensim api for dowloading the word2vec compressed model by google, it will be stored in /home/"your_username"/gensim-data/word2vec-google-news-300/ . Load the vectors and play ball. I have 16GB of RAM which is more than enough to handle the model

    import gensim.downloader as api
    
    model = api.load("word2vec-google-news-300")  # download the model and return as object ready for use
    word_vectors = model.wv #load the vectors from the model
    

提交回复
热议问题