DeepPavlov 对自己的反应进行排名

DeepPavlov ranking own responses

有人知道如何使用 deeppavlov 排名模块和自己的回复吗?文档 (http://docs.deeppavlov.ai/en/master/components/neural_ranking.html) 提供了以下代码(针对保险数据集):

rank_model = build_model(configs.ranking.ranking_insurance_interact, download=True)
predictor = rank_model.pipe[-1][-1]
candidates = ['auto insurance', 'life insurance', 'home insurance']
predictor.rebuild_responses(candidates)

但是当我将此代码用于 ubuntu 数据集时:

rank_model = build_model(configs.ranking.ranking_ubuntu_v2_bert_sep_interact, download=False)
predictor = rank_model.pipe[-1][-1]
candidates = ['environment variable', 'graphical interface', 'broken terminal']
predictor.rebuilt_responces(candidates)

原来没有rebuilt_responces方法:

AttributeError                            Traceback (most recent call last)
<ipython-input-9-e013af513ae2> in <module>
      4 predictor = rank_model.pipe[-1][-1]
      5 candidates = ['environment variable', 'graphical interface', 'broken terminal']
----> 6 predictor.rebuilt_responces(candidates)

AttributeError: 'BertSepRankerPredictor' object has no attribute 'rebuilt_responces'

有什么想法吗?

我不得不手动用数据替换文件。 github 问题中提供了解决方案:https://github.com/deepmipt/DeepPavlov/issues/862