NLTK 无法导入特定语料库 (pl196x)
NLTK cannot import a specific corpus (pl196x)
我的 NLTK 神秘地拒绝导入语料库 pl196x(包含在语料库的标准包中)。当我做 from nltk.corpus import brown
时一切顺利,但使用 from nltk.corpus import pl196x
时总是
Traceback (most recent call last): File "<input>", line 1, in <module> ImportError: cannot import name 'pl196x' from 'nltk.corpus' (C:\my\path\to\__init__.py)
并且它已经发生在多台 PC 和操作系统上。
- 我做了 nltk.download() 所有语料库,它们显示为已下载
- 文件在那里
- 我检查了
nltk.data.path
确实包含 'C:\nltk_data'
我不知道出了什么问题 - 目前对我来说唯一可能的解释是语料库不知何故停止了。任何指针将不胜感激。
导入 pl196x
语料库的正确方法是使用:
from nltk.corpus.reader import pl196x
documentation of the module 暗示了这一点。
我的 NLTK 神秘地拒绝导入语料库 pl196x(包含在语料库的标准包中)。当我做 from nltk.corpus import brown
时一切顺利,但使用 from nltk.corpus import pl196x
时总是
Traceback (most recent call last): File "<input>", line 1, in <module> ImportError: cannot import name 'pl196x' from 'nltk.corpus' (C:\my\path\to\__init__.py)
并且它已经发生在多台 PC 和操作系统上。
- 我做了 nltk.download() 所有语料库,它们显示为已下载
- 文件在那里
- 我检查了
nltk.data.path
确实包含'C:\nltk_data'
我不知道出了什么问题 - 目前对我来说唯一可能的解释是语料库不知何故停止了。任何指针将不胜感激。
导入 pl196x
语料库的正确方法是使用:
from nltk.corpus.reader import pl196x
documentation of the module 暗示了这一点。