My COde is
from nltk.parse import malt
mp = malt.MaltParser(working_dir="/other/apps/maltparser-1.8.1",mco="engmalt.poly-1.7.mco",additional_java_args=['-Xmx1024m'])
print mp.raw_parse("Hello World")
And the error is
Traceback (most recent call last):
File "malt.py", line 13, in <module>
print mp.raw_parse("Hello World")
File "/usr/local/lib/python2.7/dist-packages/nltk/parse/malt.py", line 139, in raw_parse
return self.parse(words, verbose)
File "/usr/local/lib/python2.7/dist-packages/nltk/parse/malt.py", line 126, in parse
return self.parse_sents([sentence], verbose)[0]
File "/usr/local/lib/python2.7/dist-packages/nltk/parse/malt.py", line 114, in parse_sents
return self.tagged_parse_sents(tagged_sentences, verbose)
File "/usr/local/lib/python2.7/dist-packages/nltk/parse/malt.py", line 194, in tagged_parse_sents
"code %d" % (' '.join(cmd), ret))
Exception: MaltParser parsing (java -Xmx1024m -jar /usr/local/bin/malt.jar -w /other/apps/maltparser-1.8.1 -c engmalt.poly-1.7.mco -i /other/apps/maltparser-1.8.1/malt_input.conlljOba1P -o /other/apps/maltparser-1.8.1/malt_output.conllPLcoTu -m parse) failed with exit code 1
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…