展开目录
pip安装nltk临时使用国内源
pippythonnltk
X
陈尼玛的博客
记录开发生涯的踩坑经历,用时间来验证成长
加载中

sudo pip3 install nltk -i https://pypi.tuna.tsinghua.edu.cn/simple

安装完成后测试:

sudo python3
Python 3.7.3 (default, Mar  6 2020, 22:34:30) 
[Clang 11.0.3 (clang-1103.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import nltk
>>> porter = nltk.PorterStemmer()
>>> porter.stem('lying')
'lie'

继续运行 text = nltk.word_tokenize("And now for something completely different")出现报错提示:

**********************************************************************
  Resource punkt not found.
  Please use the NLTK Downloader to obtain the resource:

  >>> import nltk
  >>> nltk.download('punkt')

则按照提示运行:

 nltk.download('punkt')

相关文档

暂无

随便看看

  1. sqlite 查看table的构建语句

  2. cnpm 立即同步

  3. word文件命令行打印

  4. nginx 子域名对应文件夹

  5. raw.githubusercontent.com DNS被指向127.0.0.1

  6. curl用法

  7. nodejs socks5

  8. git删除远程分支

  9. 判断变量是否 0 或者 '0'

  10. npm设置仓库地址和代理

  11. linux自启动/禁止自启动服务

  12. 树莓派配置wifi热点

  13. TIME_WAIT过多

  14. mongodb2.4 添加用户

  15. python下载文件,带进度条控制

  16. centos查看最近一次的开机时间

  17. replace2正则扩展方法

  18. 数据库清理优化

  19. youku电脑版跳过广告代码

畅言模块加载中