我想实现两阶段后备策略,我按照这篇文章进行了操作
这是我的config.yml文件
language: enpipeline: # other policies - name: DIETClassifier epochs: 100 entity_recognition: False - name: ResponseSelector epochs: 100 - name: FallbackClassifier threshold: 0.7policies: - name: TEDPolicy max_history: 10 epochs: 20 - name: AugmentedMemoizationPolicy max_history: 6 - name: RulePolicy
在rules.yml中添加了规则 –
rule: Implementation of the Two-Stage-Fallback steps: - intent: nlu_fallback - action: action_two_stage_fallback - active_loop: action_two_stage_fallback
以及在domain.yml中的响应
responses: utter_ask_rephrase: - text: I'm sorry, I didn't quite understand that. Could you rephrase?
然而,当意图置信度为goodbye0.23时,它执行的是goodbye而不是后备策略。
我是不是漏掉了什么?
回答:
我需要为RulePolicy提及几个参数
- name: RulePolicy core_fallback_threshold: 0.3 core_fallback_action_name: "action_default_fallback" enable_fallback_prediction: True
现在它可以工作了