Resource u'tokenizers/punkt/english.pickle' not found

前端 未结 17 2061
粉色の甜心
粉色の甜心 2020-12-13 01:49

My Code:

import nltk.data
tokenizer = nltk.data.load(\'nltk:tokenizers/punkt/english.pickle\')

ERROR Message:

[ec2-user@ip-         


        
17条回答
  •  执念已碎
    2020-12-13 02:25

    My issue was that I called nltk.download('all') as the root user, but the process that eventually used nltk was another user who didn't have access to /root/nltk_data where the content was downloaded.

    So I simply recursively copied everything from the download location to one of the paths where NLTK was looking to find it like this:

    cp -R /root/nltk_data/ /home/ubuntu/nltk_data
    

提交回复
热议问题