2017-03-02 62 views
1

我想,它包含使用python3.5 gensim-1.0西班牙語單詞加載一個模型,但模型,當我做gensim.models.KeyedVectors.load_word2vec_format(mymodel) CLI中這樣說:問題加載西班牙數據

Traceback (most recent call last): 
    File "./prueba.py", line 30, in <module> 
    model = KeyedVectors.load_word2vec_format('./data/WikiModelEsp/wiki.size.800.window.5.mincount.50.new.model', binary=True) 
    File "/usr/local/lib/python3.5/dist-packages/gensim/models/keyedvectors.py", line 192, in load_word2vec_format 
    header = utils.to_unicode(fin.readline(), encoding=encoding) 
    File "/usr/local/lib/python3.5/dist-packages/gensim/utils.py", line 231, in any2unicode 
    return unicode(text, encoding, errors=errors) 
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte 

我嘗試使用encoding='latin1'binary=True調用加載函數,但仍不起作用。

回答

0

您是否只嘗試加載功能?像這樣: model = KeyedVectors.load(path_model)