在nltk中解析时,Malt Parser出错

时间:2016-02-20 20:20:44

标签: python parsing nltk

当我尝试解析句子时,它给出了以下异常。下面是我用于解析的以下代码。

mp=MaltParser("C:/Users/mustufain/Desktop/Python Files/maltparser-1.8.1","C:/Users/mustufain/Desktop/Python Files/maltparser-1.7.2/engmalt.poly-1.7.mco")

sent1 = ['John','sees','Mary', '.']

parsed_sent1 = mp.parse_one(sent1)     


Traceback (most recent call last):
  File "<pyshell#91>", line 1, in <module>
    parsed_sent1 = mp.parse_one(sent1)
  File "C:\Python34\lib\site-packages\nltk\parse\api.py", line 66, in parse_one
    return next(self.parse(sent, *args, **kwargs), None)
  File "C:\Python34\lib\site-packages\nltk\parse\api.py", line 45, in parse
    return next(self.parse_sents([sent], *args, **kwargs))
  File "C:\Python34\lib\site-packages\nltk\parse\malt.py", line 184, in parse_tagged_sents
    "code %d" % (' '.join(cmd), ret))
Exception: MaltParser parsing (java -cp C:/Users/mustufain/Desktop/Python Files/maltparser-1.8.1\maltparser-1.8.1.jar:C:/Users/mustufain/Desktop/Python Files/maltparser-1.8.1\lib\liblinear-1.8.jar:C:/Users/mustufain/Desktop/Python Files/maltparser-1.8.1\lib\log4j.jar:C:/Users/mustufain/Desktop/Python Files/maltparser-1.8.1\lib\libsvm.jar org.maltparser.Malt -c engmalt.poly-1.7.mco -i C:\Users\MUSTUF~1\AppData\Local\Temp\malt_input.conll.v3sh5dn4 -o C:\Users\MUSTUF~1\AppData\Local\Temp\malt_output.conll.rrt8v_45 -m parse) failed with exit code 1

0 个答案:

没有答案