简体   繁体   English

NLTK。 Punkt没找到

[英]NLTK. Punkt not found

As the title suggests, punkt isn't found. 正如标题所示,找不到朋友。 Of course, I've already import nltk and nltk.download('all') . 当然,我已经import nltknltk.download('all')

This still doesn't solve anything and I'm still getting this error: 这仍然没有解决任何问题,我仍然收到此错误:

Exception Type: LookupError Exception Value: 异常类型:LookupError异常值:
NLTK tokenizers are missing. 缺少NLTK标记器。 Download them by following command: python -c "import nltk; nltk.download('punkt')" 通过以下命令下载它们:python -c“import nltk; nltk.download('punkt')”

I ran nltk.data.path and it output 我运行nltk.data.path并输出

['/root/nltk_data', '/usr/nltk_data', '/usr/share/nltk_data', '/usr/lib/nltk_data', '/usr/share/nltk_data', '/usr/local/share/nltk_data', '/usr/lib/nltk_data', '/usr/local/lib/nltk_data']

punkit is under /root/nltk_data and I've already checked file permissions. punkit在/root/nltk_data ,我已经检查了文件权限。

Anything I'm missing? 我缺少什么?

Which module have you tried to import from nltk? 您尝试从nltk导入哪个模块? After importing nltk try to download that module alone using nltk.download('module' ).. 导入nltk后尝试使用nltk.download('module')单独下载该模块。

Turns out the user didn't have permission to access the file. 原来用户没有访问该文件的权限。

Answer here: different nltk results in django and at command line 在这里回答: 不同的nltk导致django和命令行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM