0

When I try to parse the sentence it gives me the following exception.Below is the following code which I am using for parsing.

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
Mustufain
  • 198
  • 12
  • Unfortunately the error message isn't very informative beyond what java command has been called. Though, have you yet had a look at [How to use malt parser in python nltk](http://stackoverflow.com/questions/14009330/how-to-use-malt-parser-in-python-nltk)? – das-g Feb 20 '16 at 20:32
  • @das-g Yes I have seen this question I have done all the required steps malt parser is loading fine but when I parse a sentence it gives me this exception – Mustufain Feb 21 '16 at 13:40

0 Answers0