Why are multiple model files created in gensim word2vec?

前端 未结 1 826
情歌与酒
情歌与酒 2020-12-11 01:18

When I try to create a word2vec model (skipgram with negative sampling) I received 3 files as output as follows.

word2vec (File)
word2vec.syn1nef.npy (NPY fi         


        
相关标签:
1条回答
  • 2020-12-11 01:55

    Models with larger internal vector-arrays can't be saved via Python 'pickle' to a single file, so beyond a certain threshold, the gensim save() method will store subsidiary arrays in separate files, using the more-efficient raw format of numpy arrays (.npy format).

    You still load() the model by just specifying the root model filename; when the subsidiary arrays are needed, the loading code will find the side files – as long as they're kept beside the root file. So when moving a model elsewhere, be sure to keep all files with the same root filename together.

    0 讨论(0)
提交回复
热议问题