【发布时间】:2016-04-29 15:30:01
【问题描述】:
我正在尝试使用 NLTK,斯坦福自然语言工具包。 安装所需文件后,我开始执行演示代码: http://www.nltk.org/index.html
>>> import nltk
>>> sentence = """At eight o'clock on Thursday morning
... Arthur didn't feel very good."""
>>> tokens = nltk.word_tokenize(sentence)
>>> tokens
['At', 'eight', "o'clock", 'on', 'Thursday', 'morning',
“亚瑟”、“做过”、“不”、“感觉”、“非常”、“好”、“。”]
>>> tagged = nltk.pos_tag(tokens)
>>> tagged[0:6]
[('At', 'IN'), ('eight', 'CD'), ("o'clock", 'JJ'), ('on', 'IN'),
('星期四', 'NNP'), ('早上', 'NN')]
>>> entities = nltk.chunk.ne_chunk(tagged)
>>> entities
然后我收到消息:
LookupError:
===========================================================================
NLTK was unable to find the gs file!
Use software specific configuration paramaters or set the PATH environment variable.
我试过谷歌,但没有人知道丢失的 gs 文件是什么。
【问题讨论】: