DeepPavlov
DeepPavlov copied to clipboard
AttributeError: 'NoneType' object has no attribute 'form' в kbqa_cb_rus
Запускаю модель kbqa для русского языка
from deeppavlov import configs, build_model
kbqa_model = build_model(configs.kbqa.kbqa_cq_rus, download=False)
ans = input()
print(kbqa_model([ans]))
Один вопрос (а именно "на каком месте Россия по площади территории?") из ~50 проверенных приводит к ошибке:
Traceback (most recent call last):
File "/home/ddd/PycharmProjects/pythonProject/main.py", line 11, in <module>
print(kbqa_model([ans]))
File "/home/ddd/.local/lib/python3.6/site-packages/deeppavlov/core/common/chainer.py", line 207, in __call__
return self._compute(*args, param_names=self.in_x, pipe=self.pipe, targets=self.out_params)
File "/home/ddd/.local/lib/python3.6/site-packages/deeppavlov/core/common/chainer.py", line 230, in _compute
res = component.__call__(*x)
File "/home/ddd/.local/lib/python3.6/site-packages/deeppavlov/models/kbqa/tree_to_sparql.py", line 60, in __call__
log.debug(f"syntax tree info, root: {root.form}")
AttributeError: 'NoneType' object has no attribute 'form'
Thank you for this issue, the bug will be fixed in the next release.
@prshir, sorry for the late response. We tested this issue on DeepPavlov version 1.2.0 and didn’t encounter the described problem. If you are still having difficulties with this, please let us know.