RulePolicy: Replace `...` in YAML training data
See original GitHub issueGeneral information Related discussion: Notion
Consider a rule like the following:
- rule: Submit form
steps:
# Condition that form is active.
- form: loop_q_form
- ...
- action: loop_q_form
- form: null
- slot: requested_slot
value: null
# The action we want to run when the form is submitted.
- action: utter_stop
Everything before the ...
is the condition for the rule to apply. We want to make this explicit by moving the condition steps to a special key condition
. The rule would then look like:
- rule: Submit form
condition:
# Condition that form is active.
- form: loop_q_form
steps:
- action: loop_q_form
- form: null
- slot: requested_slot
value: null
# The action we want to run when the form is submitted.
- action: utter_stop
There a currently two other applications for ...
in rules besides conditions:
- the lack of
...
at the start of a rule indicates that the rule only applies at conversation start. As this is way less frequent than having a rule which can apply at all conversation parts, we need to replace this with a different construct ...
at the end of the rulesteps
indicate that the rule should not predictaction_listen
once the rule is finished, but that another action (e.g. from a different rule / story) should be predicted
Steps to Solution
- enable YAML reader to parse steps from
condition
key. It’s probably easier to keep the conversation events as they are, which means that thecondition
part should be insert as the initial conversation events, followed by aActionExecuted("...")
and then the remaining steps fromsteps
. Phrased differently: No need to touch anything besides the yaml reader. We just translate thecondition
to what we currently have (unless this is a huge implementation pain) - these steps might make sense to do as part of the issue depending on the discussion state:
- replace
...
at the end of a rule with another indicator to tell Rasa to not predictaction_listen
at the end of a rule - find a different indicator than the missing
...
at the start ofsteps
to tell Rasa that a rule is only applicable at the beginning of a story
- replace
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Policies - Rasa
The MemoizationPolicy remembers the stories from your training data. It checks if the current conversation matches the stories in your stories.yml file. If...
Read more >integrate RulePolicy with YAML training data reader #6065
With the new RulePolicy we got stories and rules. They have to be distinguishable for the polices, so that the policies can decide...
Read more >Replace with YAML | Buddy: The DevOps Automation Platform
The type of the action. Should be set to REPLACE . replacements. Required, Replacement[], The list of pairs of strings for replacement.
Read more >panos_security_rule - Create security rule policy on PAN-OS ...
Parameter Choices/Defaults Comments
action Default: allow Action to apply once rules maches.
antivirus Default: None Name of the already defined antivirus profile.
application Default: any List...
Read more >Handling chatbot failure gracefully | by Aniruddha Karajgi
No matter how well you train your Rasa Chatbot, there are going to be ... is used to specify the threshold for NLU...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The current suggestion for the start of the conversation is something like:
There’s been some debate as to whether it should say
conversation_started
instead ofaction: action_session_start
to make it clearer to the user.The current suggestion for the end of the conversation is:
This key should only need to be added when the case is not the default option of waiting for user input after a predicted action.
Let me know if anyone has more questions on this topic
Awesome, will work it in, merge and then update docs 🎉 Thanks for your input!