尝试运行Stanford CoreNLP时出现pexpect EOF错误

时间:2020-04-09 04:43:26

标签: python pexpect

我正在尝试使用Python包装器运行斯坦福大学的CoreNLP。当我运行代码时,收到错误消息:

Traceback (most recent call last):                                                                                                                                                                                                               
  File "./corenlp.py", line 257, in <module>
    nlp = StanfordCoreNLP()
  File "./corenlp.py", line 176, in __init__
    self.corenlp.expect("done.", timeout=200) # Loading PCFG (~3sec)
  File "/home/user1/anaconda3/envs/user1conda/lib/python3.7/site-packages/pexpect/spawnbase.py", line 344, in expect
    timeout, searchwindowsize, async_)
  File "/home/user1/anaconda3/envs/user1conda/lib/python3.7/site-packages/pexpect/spawnbase.py", line 372, in expect_list
    return exp.expect_loop(timeout)
  File "/home/user1/anaconda3/envs/user1conda/lib/python3.7/site-packages/pexpect/expect.py", line 179, in expect_loop
    return self.eof(e)
  File "/home/user1/anaconda3/envs/user1conda/lib/python3.7/site-packages/pexpect/expect.py", line 122, in eof
    raise exc
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7fde11758350>
command: /home/user1/anaconda3/envs/user1conda/bin/java
args: ['/home/user1/anaconda3/envs/user1conda/bin/java', '-Xmx1800m', '-cp', './stanford-corenlp-python/stanford-corenlp-full-2018-10-05/stanford-corenlp-3.9.2.jar:./stanford-corenlp-python/stanford-corenlp-full-2018-10-05/stanford-corenlp-3.9.2-models.jar:./stanford-corenlp-python/stanford-corenlp-full-2018-10-05/joda-time.jar:./stanford-corenlp-python/stanford-corenlp-full-2018-10-05/xom.jar:./stanford-corenlp-python/stanford-corenlp-full-2018-10-05/jollyday.jar', 'edu.stanford.nlp.pipeline.StanfordCoreNLP', '-props', 'default.properties']
buffer (last 100 chars): b''
before (last 100 chars): b'rdCoreNLP.java:188)\r\n\tat edu.stanford.nlp.pipeline.StanfordCoreNLP.main(StanfordCoreNLP.java:1388)\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 28826
child_fd: 5
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile(b'done.')

我尝试在这里查看其他答案,但无法收到解决我问题的方法。 This question from two years ago与我同在,但没有答案。

我可以尝试些什么?谢谢。

0 个答案:

没有答案
相关问题