I check current version of NLTK directly from its SVN repository but have got an error:
Traceback (most recent call last):
File "/home/gaspar/Documentos/tests-nltk/nltkboxertest.py", line 2, in <module>
print Boxer().interpret('Every man sees a dog').normalize()
AttributeError: 'NoneType' object has no attribute 'normalize'
I thing it have to do with needed "--candc-printer boxer" option when executing CANDC current version with SVN repository.
So i have done some correction in code
Where boxer.py have :
args = ['--models', os.path.join(self._candc_models_path, 'boxer'),
'--output', filename]
i have:
args = ['--models', os.path.join(self._candc_models_path, 'boxer'),
'--candc-printer', 'boxer',
'--output', filename]
But doesnt seems to work anyway, it gives another error msg:
Traceback (most recent call last):
File "/home/gaspar/Documentos/tests-nltk/nltkboxertest.py", line 2, in <module>
print Boxer().interpret('Every man sees a dog').normalize()
File "/usr/lib/pymodules/python2.6/nltk/sem/boxer.py", line 56, in interpret
return self.batch_interpret([input], occur_index, sentence_id, verbose)[0]
File "/usr/lib/pymodules/python2.6/nltk/sem/boxer.py", line 78, in batch_interpret
drs_dict = self._parse_to_drs_dict(boxer_out, occur_index, sentence_id)
File "/usr/lib/pymodules/python2.6/nltk/sem/boxer.py", line 169, in _parse_to_drs_dict
assert line.startswith('sem(%s,' % drs_id)
AssertionError
Don know what else to do. Can you give some help?
If you prefer or it is better to make a POST, i can make it???
Miguel Gaspar
I can't compile C&C and BOXER version 1, so i got SVN code and compile it without problems.
But this only work if command CANDC uses --candc-printer boxer,
Traceback (most recent call last):
File "nltkboxer.py", line 587, in <module>
drs = Boxer().interpret(args[0], verbose=options.verbose)
File "nltkboxer.py", line 56, in interpret
return self.batch_interpret([input], occur_index, sentence_id, verbose)[0]
File "nltkboxer.py", line 78, in batch_interpret
drs_dict = self._parse_to_drs_dict(boxer_out, occur_index, sentence_id)
File "nltkboxer.py", line 169, in _parse_to_drs_dict
assert line.startswith('sem(%s,' % drs_id)
AssertionError
2010/6/9 Dan Garrette
<dhgar...@gmail.com>
Hi Miguel,
Are you using one of the standard NLTK distributions? If so, then the boxer interface will not be included since it is new. You should download the module from [1]. You may also need to get the updated versions of logic.py [2] and drt.py [3]. Alternatively, you can just check out the current version of NLTK directly from its SVN repository. This will, of course, have all the newest features.
-Dan
[1] http://nltk.googlecode.com/svn/trunk/nltk/nltk/sem/boxer.py
[2] http://nltk.googlecode.com/svn/trunk/nltk/nltk/sem/logic.py
[3] http://nltk.googlecode.com/svn/trunk/nltk/nltk/sem/drt.pyOn Wed, Jun 9, 2010 at 10:12 AM, Miguel Ferreira Gaspar
<miguel...@eb23andreresende.net> wrote:
I Dan, congratulations on working!
How can I integrate the interface and uses it in NLTK. I have already
installed and CANDC BOXER but trying to run in NLTK gives me error:
>>> from nltk import Boxer
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
from nltk import Boxer
ImportError: cannot import name Boxer
>>>
Best Regards
Miguel Gaspar