I want to be able to use Boxer as a semantic extractor inside NLTK.
I am testing with the following code:
#!/bin/env python
import nltk
x = nltk.sem.boxer.Boxer()
x.interpret("The capital of Spain is Madrid .")
The failure is the following:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/nltk/sem/boxer.py", line 83, in interpret
d, = self.batch_interpret_multisentence([[input]], discourse_ids, question, verbose)
File "/usr/lib/python2.7/site-packages/nltk/sem/boxer.py", line 140, in batch_interpret_multisentence
drs_dict = self._parse_to_drs_dict(boxer_out, use_disc_id)
File "/usr/lib/python2.7/site-packages/nltk/sem/boxer.py", line 241, in _parse_to_drs_dict
line = lines[i]
IndexError: list index out of range
From the nltk code, I found at http://nltk.org/_modules/nltk/sem/boxer.html#Boxer that in the _parse_to_drs_dict(self, boxer_out, use_disc_id) function, it does a i += 4
that I haven't been able to understand.
Am I feeding something bad to the Boxer?
Did anyone manage to make it work?
Manually debugging step-by-step, the NLTK actually gets the output from candc and boxer.