nltk.stem.WordNetLemmatizer()时报错BadZipFile(“File is not a zip file“)的解决方法
nltk.stem.WordNetLemmatizer()时报错BadZipFile(“File is not a zip file“)的解决方法
问题描述
nltk里有个库可以很方便的还原单词的基本型,调用方法如下:
from nltk.stem import WordNetLemmatizer
lamma = WordNetLemmatizer()
lamma.lemmatize('cars', 'n')
安装完nltk,然后下载对应的语料库(python环境下执行)
import nltk
nltk.download("wordnet")
nltk.download("omw-1.4")
一般linux下的下载位置为 /home/[user_name]/nltk_data/corpura
1.File is not a zip file报错
文件不是一个zip(首先是wordnet.zipwen文件未下载完成)
##报错信息
zipfile.BadZipFile: File is not a zip file
2.owm-1.4不存在
githup上nltk_data整个库下载下来有664m,可以使用迅雷下载(比较快);下面文件地址附带了对应文件的下载网址;
原因解释:
一般linux下的下载位置为 /home/[user_name]/nltk_data/corpura
- 首先是看看
wordnet.zip
和omw-1.4.zip
,大小分别为12m
和11m
; ntlk的数据在下载时不完整导致; omw-1.4.zip
是不存在的,githup
上下载下来只有omw.zip
;解决方案通过修改omw.zip
为omw-1.4.zip
,并将其解压为omw-1.4
;- 文件的地址: wordnet.zip 和 omw-1.4.zip
一系列操作过后,效果展示:
参考资料:
[1]: https://blog.csdn.net/weixin_41848012/article/details/124535050
nltk.stem.WordNetLemmatizer()时报错BadZipFile(“File is not a zip file“)的解决方法相关推荐
- caffe中在某一层获得迭代次数的方法以及caffe编译时报错 error: ‘to_string‘ is not a member of ‘std‘解决方法
caffe中在某一层获得迭代次数的方法以及caffe编译时报错 error: 'to_string' is not a member of 'std'解决方法 参考文章: (1)caffe中在某一层获 ...
- 使用nltk.stem.wordnet.WordNetLemmatizer()时报错BadZipFile(“File is not a zip file“)的解决方法
问题描述 nltk里有个库可以很方便的还原单词的root形式,调用方法如下: import nltk lem = nltk.stem.wordnet.WordNetLemmatizer() name ...
- 安装TortoiseSVN时报错Could not write value {30351348-7B7D-4FCC-81B4-1E394CA267EB} to key……的解决方法
我想重装个新版本TortoiseSVN,结果卸载后重装一直报错Could not write value {30351348-7B7D-4FCC-81B4-1E394CA267EB} to key-- ...
- FreeRADIUS整合微软活动目录做身份验证时报错“winbind client not authorized to use winbindd_pam_auth_crap”的解决方法
FreeRADIUS使用微软活动目录做身份验证时,当客户端发起认证请求到radius服务器时,radius服务器报错"winbind client not authorized to use ...
- 关于安装Adobe CC系列Photoshop等软件时报错无法写入注册表值错误代码160问题的解决方法
几个月前在研究音频处理时试图更新Audition出错,今天更新PS和AI再度出错,于是在C:\Program Files (x86)\Common Files\Adobe\Installers下找到i ...
- Win7安装VS2015时报错,Sqldom.msi文件丢失或损坏的解决方法
1.报错的原因:Win7系统中缺少microsoft root certificate authority 2010.microsoft root certificate authority 2011 ...
- LoadRunner使用odbc时报错can't get hostname for your address的解决方法
此问题以前没有出现过,是这次在我带领的小强性能测试班中有个别同学出现了这个问题,正好也就整理下说下解决方法吧. 此问题是由于检测hostname的时候出现的问题,解决方法如下: 1.在本机的hosts ...
- 安装完MySQL后启动报错_MySQL数据库之mysql编译安装完成后,启动时报错The server quit without updating PID file...
本文主要向大家介绍了MySQL数据库之mysql编译安装完成后,启动时报错The server quit without updating PID file ,通过具体的内容向大家展现,希望对大家学习 ...
- 解决安装下载好的whl库包时,报错:zipfile.BadZipFile: File is not a zip file
文章目录: 1 问题说明 2 解决问题 1 问题说明 我是在Jetson NX(arm架构)上安装tensorflow的时候,首先把tensorflow的安装包下载下来 1.tensorflow==1 ...
最新文章
- jdk与jre的区别(转)
- Eclipse_Eclipse下配置Maven
- golang reflect Pointer 获取 传入的interface信息
- springboot中java泛型使用
- python字符串与列表与运算_[Python学习笔记1]Python语言基础 数学运算符 字符串 列表...
- 【Qt】QModbusDataUnit类
- android url 快捷方式,Android向桌面添加快捷方式,使其指向特定的(URL)网页
- 更改TFS项目中的SharePoint网站端口
- 谈谈我们熟悉但未必了解的磁带库
- 爬取哔哩哔哩单个视频
- SQL Server 2008 用户SA登录失败(错误18456)之图文解决方法
- win7无法连接打印机拒绝访问_win7系统共享打印机拒绝访问的完美解决方法
- win7电脑无法设置默认打开方式
- 吴恩达-机器学习-多元线性回归模型代码
- 国内各大短视频平台去水印接口,新年限时免费使用。
- ISP(二) Demosiac 去马赛克 (CIP)
- cad2014打开文件崩溃_CAD2014非正常关闭后,临时文件打不开如何解决?
- 2022年执业兽医考试模拟题及答案
- phpyun joblist标签动态参数使用方法
- 中山大学软件工程专硕考研经验(双非跨考)