我正在使用基于英语维基百科的快速文本预训练模型。它按预期工作...
https://github.com/shantanuo/pandas_examples/blob/master/nlp/fasttext_english.ipynb
但是,当我使用其他语言尝试相同的代码时,出现此页面上显示的错误...
https://github.com/shantanuo/pandas_examples/blob/master/nlp/fasttext_marathi.ipynb
该错误与unicode有关:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 15: invalid start byte
我尝试使用Raw Binary选项打开文件。我在load.py文件中更改了函数load_words_raw:
with open(file_path, 'rb') as f:
现在我得到了另一个错误:
ValueError:无法将字符串转换为浮点型:b'\ x00l \ x02'
我不知道该如何处理。
您应该将笔记本文件的第二行更改为:
#!wget https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.mr.300.vec.gz
因此,指向vec文件而不是bin文件:
#!wget https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.mr.300.bin.gz
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句