2

I am getting problems to access Stanford parser through python NLTK (they developed an interface for NLTK)

import nltk.tag.stanford

Traceback (most recent call last):

File "", line 1, in

ImportError: No module named stanford

Riadh Belkebir
  • 797
  • 1
  • 12
  • 34
  • This questions may have the answer: http://stackoverflow.com/questions/8555312/instantiating-and-using-stanfordtagger-within-nltk – dmcc Feb 08 '14 at 23:04
  • thank you but that doesn't help i have already seen this link – Riadh Belkebir Feb 09 '14 at 06:18
  • If your import is failing, you have a version of the nltk that does not include `stanford` in its `tag` package. That's all there is to this question. – alexis May 30 '14 at 14:53

2 Answers2

4

You can use stanford parser from NLTK. Check this link on how to use it - http://www.nltk.org/api/nltk.tag.html#module-nltk.tag.stanford

I guess it isn't problem with the stanford module in NLTK, it works well for me. Check your NLTK version. Older versions doesn't have stanford modules in it. Try the latest version of NLTK.

You can also use this python wrapper for stanford parser which is very efficient because of it varied approach.

    https://bitbucket.org/torotoki/corenlp-python
wagin
  • 156
  • 3
-2

There is no module named stanford in NLTK.You can store output of stanford parser and make use of it through python program.

user3189037
  • 51
  • 2
  • 7
  • thank you but i have tried to find a way to include it by i don't know how – Riadh Belkebir Feb 09 '14 at 06:58
  • The OP's import works for me and others, so clearly the problem is either the nltk version or something trivial like naming the script `nltk.py` (but then the error would be "no module named tag.stanford"). – alexis May 30 '14 at 14:57