Python NLTK库安装Error:Resource u*corpora/gutenberg* not found.
来源:互联网 发布:java用什么软件编程 编辑:程序博客网 时间:2024/06/06 20:50
转载请标明出处:
http://blog.csdn.net/djy1992/article/details/72828734
本文出自:【奥特曼超人的博客】
提起聊天机器人, 想必大家会想起一个优秀的库,NLTK库,这里简化了安装流程并提到大家都会遇到的一个错误。
Resource u*corpora/gutenberg* not found. Please use the NLTKDownloader to obtain the resource:
运行环境:
WIN+Python 2.7
安装:
pip install nltk
运行
from nltk.book import *
然后出错:
Resource u*corpora/gutenberg* not found. Please use the NLTKDownloader to obtain the resource.
想起未安装内容库,用命令down下来:
import nltknltk.download()
弹出界面:
选择 Download Directory 的时候要注意,默认路径是从这几个地方查找的,这里我放的是: C:\Python27\Lib\nltk_data
。
需要注意: 安装位置不对也会报错,所以要找到相应的位置进行解压。
我选的是all download,发现太慢,先下载 book 了,反正有个模块调用成功就行 ( 下载会比较慢,你懂的 )。
*** Introductory Examples for the NLTK Book ***Loading text1, ..., text9 and sent1, ..., sent9Type the name of the text or sentence to view it.Type: 'texts()' or 'sents()' to list the materials.text1: Moby Dick by Herman Melville 1851text2: Sense and Sensibility by Jane Austen 1811text3: The Book of Genesistext4: Inaugural Address Corpustext5: Chat Corpustext6: Monty Python and the Holy Grailtext7: Wall Street Journaltext8: Personals Corpustext9: The Man Who Was Thursday by G . K . Chesterton 1908
测试下命令。
>>> text1<Text: Moby Dick by Herman Melville 1851>
成功输出,这里输出的是书籍标题 Moby Dick by Herman Melville 1851,证明已经是OK了,这里提供份百度云下载,下载完记得 解压,不然会 报同样的错误无法找到相关内容:
链接: http://pan.baidu.com/s/1kV5dM6N 密码: imde
|| 版权声明:本文为博主杜锦阳原创文章,转载请注明出处。
阅读全文
1 0
- Python NLTK库安装Error:Resource u*corpora/gutenberg* not found.
- python运行时提示“ Resource u'taggers/maxent_treebank_pos_tagger/english.pickle' not found. ”
- nltk在python中的安装,以及nltk的data库
- python gutenberg古腾堡语料库
- ignore-resource-not-found
- 安装ffmpeg库的错误:ERROR: libtheora not found
- Python安装nltk模块
- windows7 安装python +nltk
- uwsgi error python application not found
- 安装Python扩展时,Configure error: Python headers not found错误解决办法
- Python:调用NLTK报错LookupError: Recource 'tokenizers/punkt/english.pickle' not found(基于Anaconda)
- python安装软件出现错误 fatal error: 'libxml/xmlversion.h' file not found
- wamp Could not execute menu item和 HTTP Error 404. The requested resource is not found.
- file not found resource.cfg
- Jasper SubReport Resource Not Found
- Android resource not found问题
- 安装mysql-python:EnvironmentError: mysql_config not found
- 安装mysql-python:EnvironmentError: mysql_config not found
- 练习33
- 写作建议
- application.html.erb
- iOS Xcode 快捷键总结
- 我将进化成一条狗(9)——基因治疗
- Python NLTK库安装Error:Resource u*corpora/gutenberg* not found.
- 基于XMPP的即时通讯
- 判断 & 是否随着用户退出 进程退出
- Flex布局
- Python生成MD5的方法
- 调起引用市场,引导用户进行评分
- Linq日期差值计算,Linq日期比较方法
- 多属性决策模型
- SSL交互(握手)过程详解