I am trying to use NLTK, a Stanford natural language toolkit. After installing the necessary files, I run the demo code: 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',
"Arthur," "did," "not," "feel," "very," "good," "." )
>>> tagged = nltk.pos_tag(tokens) >>> tagged[0:6] [('At', 'IN'), ('eight', 'CD'), ("o'clock", 'JJ'), ('on', 'IN'),
("Thursday", "NNP"), ("morning", "NN")]
>>> entities = nltk.chunk.ne_chunk(tagged) >>> entities
Then I get the message:
LookupError: =========================================================================== NLTK was unable to find the gs file! Use software specific configuration paramaters or set the PATH environment variable.
I tried Google, but no one there will say that the gs file is missing.
python nlp nltk
Jie hu
source share