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”进行模型下载,下载需要等待十秒即可。

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


相关文章
|
10月前
|
安全 Java API
Eclipse 打开marketplace 报PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
网上有很多解决的帖子,我这里只是记录一下方便自己查阅 主要原因是java本身需要证书 1、按导入安全证书的方法解决
1030 0
Eclipse 打开marketplace 报PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
|
7月前
|
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:
ERROR: No matching distribution found for gradio>=3.23
该博客文章提供了解决使用pip安装gradio版本3.23时出现的"No matching distribution found"错误的步骤,包括从官网下载相应的whl文件并手动安装。
ERROR: No matching distribution found for gradio>=3.23
|
8月前
|
自然语言处理 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:
1038 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
|
8月前
|
自然语言处理 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:
546 0
|
8月前
|
自然语言处理 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
368 0
|
数据采集 Python
|
Linux
Error: automake: Failed to download resource “m4“
Error: automake: Failed to download resource “m4“
280 0
ROS catkin build 的时候保报错 Assertion failed: check for file existence, but filename
ROS catkin build 的时候保报错 Assertion failed: check for file existence, but filename