我使用philipperemy创建了斯坦福openIE python封装在这里:https://github.com/philipperemy/Stanford-OpenIE-Python。不过,我使用的是视窗系统,所以我使用Cygwin运行下面的代码:
git clone https://github.com/philipperemy/Stanford-OpenIE-Python.git
cd Stanford-OpenIE-Python
echo "Barack Obama was born in Hawaii." > samples.txt
python main.py -f samples.txt
但是,我遇到了错误,说
AssertionError: ERROR: Call to stanford_ie exited with a non-zero code status.
我不知道如何解决它。我用的1.8.0_121一个java版本,我查了一下,如果我用$ git pull origin master
用这个Github上文件的更新版本。
有谁知道如何解决这个问题?
提前致谢!
更具体地讲,在这里完整的错误消息:
$ python main.py -f samples.txt
Namespace(filename='samples.txt', generate_graph=False, verbose=False)
Traceback (most recent call last):
File "main.py", line 147, in <module>
exit(main(argv))
File "main.py", line 142, in main
entities_relations = stanford_ie(filename, verbose, generate_graphviz)
File "main.py", line 118, in stanford_ie
assert not java_process.returncode, 'ERROR: Call to stanford_ie exited with a non-zero code status.'
AssertionError: ERROR: Call to stanford_ie exited with a non-zero code status.
直答案来自斯坦福大学OpenIE的Python的作者来是Windows操作系统并不库支持。详细here