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'
パイソン2やPython 3? –