2

I want to use Stanford parser in order to get typed dependency of a text. I was trying to follow the instructions provided in https://bitbucket.org/torotoki/corenlp-python, however, I got an error, both while launching the server and using the python library:

from corenlp import *
corenlp = StanfordCoreNLP("./stanford-corenlp-full-2014-08-27/")

This is the error:

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
pexpect/__init__.py", line 1554, in expect_loopraise EOF(str(err) + '\n' + str(self))

pexpect.EOF: End Of File (EOF). Empty string style platform.

It seems the problem is about pexpect package. I already installed it as it is explained in the insturctuion. I saw similiar problem here(EOF when using pexpect and pxssh), but it is different from my case. I am using Mac and Python 2.7.

Could you please help me!

Community
  • 1
  • 1

2 Answers2

0

This is not the solution you wanted.
Are you sure that it is the same error if you use corenlp using the package implementation ?

pexpect is required only when there is interaction with the interactive shell of corenlp, which is present in the server implementation. In the package implementation, a file containing a list of input files is given to the parser. (using batch_parse)

In the server implementation, there is a JSON-RPC server created by the wrapper. If you want to use the server implementation, you have to remotely call one of the procedures and you don't need the package on the client end. I guess, you have mistaken in putting the right code here.

PS: I, myself is one of the corenlp users but i used a different wrapper.

Vivek Anand
  • 621
  • 1
  • 7
  • 15
0

I hit the same issue while on mac. For posterity, just follow verbatim the instructions at https://bitbucket.org/torotoki/corenlp-python to use python wrapper around Stanford-corenlp. This package gets around the "End Of File (EOF). Empty string style platform." error that throws up on the some mac (or other OS, didnt check though but I know someone who also got it on windows) versions. Also don't forget to download the stanford-corenlp-full-2014-08-27.zip instead of the latest version.

The solution of using expect(pexpect.EOF) didn't work for me (https://github.com/pexpect/pexpect/blob/master/doc/overview.rst) as the Stanford-corenlp jar was not loading properly in this case.

I also tried https://github.com/dasmith/stanford-corenlp-python as well as https://github.com/Wordseer/stanford-corenlp-python but neither of them worked. Both threw up the EOF error

Abhimanu Kumar
  • 1,751
  • 18
  • 20