0
Я обновляю свои временные слова для новой версии stop-words2014.5.26
, потому что я хочу использовать арабские стоп-слова. Я работаю в Анаконде. после того, как я скачал и установил стоп-слова, появилось следующее сообщение об ошибке:stop_words для новой версии 2014.5.26
from stop_words import get_stop_words
stop=set(get_stop_words('english'))
<ipython-input-15-47cdc7fed487> in <module>()
Эта линия
stop=set(get_stop_words('english'))
выдает эту ошибку:
C:\Anaconda3\lib\site-packages\stop_words-2014.5.26-py3.5.egg\stop_words\__init__.py
in get_stop_words(language)
21 with open('{0}{1}.txt'.format(STOP_WORDS_DIR, language)) as lang_file:
22 lines = lang_file.readlines()
---> 23 return [str(line.strip()).decode('utf-8') for line in lines]
C:\Anaconda3\lib\site-packages\stop_words-2014.5.26-py3.5.egg\stop_words\__init__.py
in <listcomp>(.0)
21 with open('{0}{1}.txt'.format(STOP_WORDS_DIR, language)) as lang_file:
22 lines = lang_file.readlines()
---> 23 return [str(line.strip()).decode('utf-8') for line in lines]
AttributeError: 'str' object has no attribute 'decode'
Python 2 или Python 3? –