后退行动未被触发

问题描述 投票:0回答:1

Rasa无法检测到垃圾短语(“afdas afadfasdf”)并且无法触发fall_back_action。任何帮助将不胜感激。谢谢

training.面对

## intent:say_thanks

- Thanks you so much
- helpful it, thanks
- appreciate it, congrats
- appreciate it, helpful
- appreciate it, thanks
- nice, apreciate
- nice, lol
- really, thnx
- thanku
- thank u
- nice, thank you
- nice, thnx
- nice
- Thanks you too !
- Thank you :)

## intent:isnt_happy

- terrible performance
- i am not happy with your performance
- you are so stupid
- you are so bothersome
- you are so silly
- you are so tiresome
- don't test my patience
- dont piss me off
- you are pissing me off
- you are so annoying
- I do not approve of this bot. It's absolutely terrible .
- I am not content about this service of yours
- I am sad

policies.yml

政策:

 - name: KerasPolicy
   epochs: 1000
   max_history: 3
   batch_size: 10
   validation_split: 0.2

 - name: MemoizationPolicy
   max_history: 3
 - name: FallbackPolicy
   nlu_threshold: 0.4
   core_threshold: 0.3
   fallback_action_name: "utter_fallback_action"

domain.yml

intents:
 - say_thanks
 - isnt_happy

templates:

  utter_say_thanks:
  - text: "You're welcome :-)"
  - text: "Just doing my job!"
  - text: "Any time :-)"

  utter_isnt_happy:
  - text: "I am sorry :-("
  - text: "Sorry I didn't mean to make you sad"
  - text: "Sorry, i didn't met your expectations. My creators are working hard to improve me."

  utter_fallback_action:
  - text: "I didn't understood that. My creators are working hard to make me better."

actions:
 - utter_say_thanks
 - utter_isnt_happy
 - utter_fallback_action

stories.面对

## talk_say_thanks
* say_thanks
    - utter_say_thanks

## talk_isnt_happy
* isnt_happy
    - utter_isnt_happy
nlp rasa-nlu rasa-core
1个回答
0
投票

由于你只有两个意图,所以预测它们的置信度要高于你有更多意图。这通常不应成为问题,但在设置回退的置信度阈值时必须牢记这一点。

为了更容易检测回退,特别是在训练数据和意图很少的情况下,我建议添加第三个意图。例如out_of_scope,你添加一些不应被你的任何其他意图拾取的随机事物:

## intent:out_of_scope

- fggsf dnek ofjkfn
- I am hungry
- where are we going
- tell me a joke
- i want to book a restaurant
- jfhr qsaasr fvndveti 

现在,您可以使用回退添加故事来处理此意图。

* out_of_scope
   - utter_fallback_action
© www.soinside.com 2019 - 2024. All rights reserved.