2017-03-02 1 views
1

lädt Ich versuche, ein Modell zu laden, der das spanische Wort enthält GENSIM-1.0 in python3.5 verwenden, aber wenn ich gensim.models.KeyedVectors.load_word2vec_format(mymodel) tue die CLI sagt dies:Ausgabe ein Modell der spanischen Daten

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 

I versuchen, Ladefunktion mit encoding='latin1' und binary=True aufzurufen, funktioniert aber immer noch nicht.

Antwort

0

Haben Sie nur mit der Ladefunktion versucht? Wie dieses: model = KeyedVectors.load (path_model)