Resource punkt not found. Please use the NLTK Downloader to obtain the resource错误解决方案

简介: Resource punkt not found. Please use the NLTK Downloader to obtain the resource错误解决方案

一、首先前提是已经安装了python的nltk库(见下图),目的是调用nltk库的word_tokenize方法实现英文分词

二、在运行word_tokenize方法代码中报“Resource punkt not found. Please use the NLTK Downloader to obtain the resource”错误(见下图),翻译成中文是“找不到资源。请使用NLTK下载程序获取资源”,官方也已经明显提示我们怎么去解决这个问题。

三、在 jupyter notebook 中复制粘贴运行下面的代码,目的是打开NLTK下载资源的网页进行下载程序获取资源(见下面第二张图)。

import nltk
nltk.download()

四、成功打开页面后,首先选择点击“Models”,然后找到点击选择“punkt”模型,最后点击“Download”进行模型下载,下载需要等待十秒即可。

五、重新运行源程序的代码没有再报同样的错误就成功解决这个问题了。


相关文章
|
7月前
|
Android开发
【Bug】Android resource linking failed和error: failed linking references.
【Bug】Android resource linking failed和error: failed linking references.
|
4月前
|
Python
Resource cmudict not found. Please use the NLTK Downloader to obtain the resource:
这篇文章介绍了在使用DeepVoice3_pytorch时遇到的“Resource cmudict not found”错误,以及如何通过NLTK Downloader下载缺失的cmudict资源来解决该问题。
Resource cmudict not found. Please use the NLTK Downloader to obtain the resource:
|
5月前
|
自然语言处理 Python
【Python】已解决:Resource punkt not found. Please use the NLTK Downloader to obtain the resource:
【Python】已解决:Resource punkt not found. Please use the NLTK Downloader to obtain the resource:
533 1
Failed to load resource:9090/searchvideolist?mysearch%E8%B0%B7%E6%AD%8C:1
Failed to load resource:9090/searchvideolist?mysearch%E8%B0%B7%E6%AD%8C:1
|
5月前
|
自然语言处理 Python
【Python】已解决:Resource stopwords not found. Please use the NLTK Downloader to obtain the resource:
【Python】已解决:Resource stopwords not found. Please use the NLTK Downloader to obtain the resource:
326 0
|
5月前
|
自然语言处理 Java 开发工具
【Python】已解决Resource averaged_perceptron_tagger not found. Please use the NLTK Downloader to obtain t
【Python】已解决Resource averaged_perceptron_tagger not found. Please use the NLTK Downloader to obtain t
230 0
|
开发者
上传苹果版本时错误解决办法:No suitable application records were found. Verify your bundle identifier
上传苹果版本时错误解决办法:No suitable application records were found. Verify your bundle identifier
115 2
报错解决:Reason: Failed to determine a suitable driver class
报错解决:Reason: Failed to determine a suitable driver class
2562 0
报错解决:Reason: Failed to determine a suitable driver class