Boxer を NLTK 内のセマンティック エクストラクタとして使用できるようにしたいと考えています。
次のコードでテストしています。
#!/bin/env python
import nltk
x = nltk.sem.boxer.Boxer()
x.interpret("The capital of Spain is Madrid .")
失敗は次のとおりです。
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
nltk コードから、http://nltk.org/_modules/nltk/sem/boxer.html#Boxer で見つけた_parse_to_drs_dict(self, boxer_out, use_disc_id) 関数で、i += 4
私ができなかったことができます理解する。
ボクサーに何か悪いものを与えていますか?
誰かがそれを機能させることができましたか?
手動で段階的にデバッグすると、NLTK は実際に candc と boxer から出力を取得します。