NLTK POS 标签集帮助不起作用

NLTK POS tagset help not working

我下载的 nltk tagset 帮助无法使用。

每当我尝试通过以下方式访问标签集含义时:-

nltk.help.upenn_tagset('NN')

我得到的结果是:-

Traceback (most recent call last):
File "<pyshell#30>", line 1, in <module>
nltk.help.upenn_tagset('NN')
File "C:\Python34\lib\site-packages\nltk\help.py", line 25, in upenn_tagset
_format_tagset("upenn_tagset", tagpattern)
File "C:\Python34\lib\site-packages\nltk\help.py", line 39, in _format_tagset
tagdict = load("help/tagsets/" + tagset + ".pickle")
File "C:\Python34\lib\site-packages\nltk\data.py", line 774, in load
opened_resource = _open(resource_url)
File "C:\Python34\lib\site-packages\nltk\data.py", line 888, in _open
return find(path_, path + ['']).open()
File "C:\Python34\lib\site-packages\nltk\data.py", line 618, in find
raise LookupError(resource_not_found)
LookupError: 
**********************************************************************
Resource 'help/tagsets/upenn_tagset.pickle' not found.  Please
use the NLTK Downloader to obtain the resource:  >>>
nltk.download()
Searched in:
- 'C:\Users\aarushi/nltk_data'
- 'C:\nltk_data'
- 'D:\nltk_data'
- 'E:\nltk_data'
- 'C:\Python34\nltk_data'
- 'C:\Python34\lib\nltk_data'
- 'C:\Users\aarushi\AppData\Roaming\nltk_data'

但我已经通过 nltk.download()

从模型选项卡下载了标签集

那么我做错了什么?

正如 nltk 告诉您的那样,它在目录中搜索了文件 help/tagsets/upenn_tagset.pickle

- 'C:\Users\aarushi/nltk_data'
- 'C:\nltk_data'
- 'D:\nltk_data'
- 'E:\nltk_data'
- 'C:\Python34\nltk_data'
- 'C:\Python34\lib\nltk_data'
- 'C:\Users\aarushi\AppData\Roaming\nltk_data'

找不到。

在吗

如果没有,请使用 nltk.download() 获取它,并确保它位于这些目录之一中。

https://i.stack.imgur.com/Ri7E2.png“参考”

嗨,

检查上面标记的图像以总结需要下载的确切内容。

从 nltk.download() 下载 help_tagsets 是解决此问题最快最简单的方法之一。

可以按照以下步骤操作:-

open your jupyter notebook or python shell in your OS(thru terminal).

ask for nltk.download() - (shell/jupyter) - it will open the GUI.

search the help_datasets in ALL PACKAGES column.

只需下载 :-) 给你。