今天刚学习NLP时,在使用NLTK的

import nltk

>>> text = "welcome reader.I hope you find it interesting.please do reply."
>>> from nltk.tokenize import sent_tokenize

>>> sent_tokenize(text)

进行分词的时候出现如下的错误:

使用NLTK时出现Resource [93mpunkt[0m not found.

原因在于缺少一个模块

解决办法:输入

>>> nltk.download()

出现如下界面,点击下载模块punkt

使用NLTK时出现Resource [93mpunkt[0m not found.

下载完punkt之后,word_tokenize可以分词成功了,如图:

使用NLTK时出现Resource [93mpunkt[0m not found.

相关文章:

  • 2021-10-18
  • 2021-10-12
  • 2021-10-24
  • 2022-12-23
  • 2021-12-04
  • 2021-12-06
猜你喜欢
  • 2021-07-11
  • 2021-10-23
  • 2022-01-13
  • 2021-05-09
  • 2021-08-30
相关资源
相似解决方案