2

有谁知道,如何使用带有自己响应的 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'

有任何想法吗?

4

1 回答 1

0

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

于 2019-06-07T07:49:50.063 回答