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