有没有人知道,如何在自己的回复中使用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'有什么想法吗?
发布于 2019-06-07 15:49:50
我不得不手动用数据替换文件。github问题中提供了解决方案:https://github.com/deepmipt/DeepPavlov/issues/862
https://stackoverflow.com/questions/56378147
复制相似问题