Search code examples
deep-learningnlpsearch-enginedeeppavlov

DeepPavlov ranking own responses


Does anybody know, how to use deeppavlov ranking module with own responses? Documentation (http://docs.deeppavlov.ai/en/master/components/neural_ranking.html) provides the following code (for insurance dataset):

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)

But when I use this code for ubuntu dataset:

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)

it turns out that there is no rebuilt_responces method:

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'

Any ideas?


Solution

  • I had to manually replace files with data. The solution is provided in github issue: https://github.com/deepmipt/DeepPavlov/issues/862