0

Hi I am trying to get the tokens int he format:

Token(index=1, form='some', cpos='DT', pos='DT', head=3, deprel='det') Token(index=2, form='blue', cpos='JJ', pos='JJ', head=3, deprel='amod') Token(index=3, form='moose', cpos='NN', pos='NN', head=0, deprel='root')

When passed "some blue moose". When i run below code

>>> import StanfordDependencies
>>> sd = StanfordDependencies.get_instance(backend='subprocess')
>>> sent = sd.convert_tree('(S1 (NP (DT some) (JJ blue) (NN moose)))')

for convert_tree(), i am getting the error.

File "D:\ABC\anaconda\lib\site-packages\StanfordDependencies\SubprocessBackend.py", line 127, in _raise_on_bad_exit_or_output raise ValueError("Bad exit code from Stanford CoreNLP") ValueError: Bad exit code from Stanford CoreNLP

Can someone help me how to resolve this.

Deepa Huddar
  • 321
  • 1
  • 4
  • 15

1 Answers1

0

You should look over this response to how to you Stanford CoreNLP with Python:

cannot use pycorenlp for python3.5 through terminal

It shows how to start a StanfordCoreNLP server and make requests via Python. If you include the depparse annotator in your list of annotators you can get back dependency parses.

Community
  • 1
  • 1
StanfordNLPHelp
  • 8,699
  • 1
  • 11
  • 9