-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6088 from RasaHQ/rules
Rules
- Loading branch information
Showing
86 changed files
with
6,451 additions
and
773 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Introduced a new `YAML` format of the Core training data and implemented a parser for it. | ||
Rasa Open Source can now read stories in both `Markdown` and `YAML` formats. | ||
Introduced a new ``YAML`` format for Core training data and implemented a parser | ||
for it. Rasa Open Source can now read stories in both ``Markdown`` and ``YAML`` format. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add support for rule data and forms in YAML format. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Added the new dialogue policy ``RulePolicy`` which will replace the old "rule-like" | ||
policies :ref:`mapping-policy`, :ref:`fallback-policy`, | ||
:ref:`two-stage-fallback-policy`, and :ref:`form-policy`. These policies are now | ||
deprecated and will be removed in the future. Please see ``examples/rules`` | ||
for a usage example. | ||
|
||
Added new NLU component ``FallbackClassifier`` which predicts an intent ``nlu_fallback`` | ||
in case the confidence was below a given threshold. The intent ``nlu_fallback`` may | ||
then be used to write stories / rules to handle the fallback in case of low NLU | ||
confidence. | ||
|
||
.. code-block:: | ||
pipeline: | ||
- ... # Other NLU components | ||
- name: FallbackClassifier | ||
# If the highest ranked intent has a confidence lower than the threshold then | ||
# the NLU pipeline predicts an intent `nlu_fallback` which you can then be used in | ||
# stories / rules to implement an appropriate fallback. | ||
threshold: 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
>> rule 1 | ||
- form{"name": "loop_q_form"} <!-- condition that form is active--> | ||
- slot{"requested_slot": "some_slot"} <!-- some condition --> | ||
- ... | ||
* inform{"some_slot":"bla"} <!-- can be ANY --> | ||
- loop_q_form <!-- can be internal core action, can be anything --> | ||
|
||
>> rule 2 | ||
- form{"name": "loop_q_form"} <!-- condition that form is active--> | ||
- slot{"requested_slot": "some_slot"} <!-- some condition --> | ||
- ... | ||
* explain <!-- can be anything --> | ||
- utter_explain_some_slot | ||
- loop_q_form | ||
- form{"name": "loop_q_form"} <!-- condition that form is active--> | ||
|
||
>> rule 3 | ||
- form{"name": "loop_q_form"} <!-- condition that form is active--> | ||
- ... | ||
- loop_q_form <!-- condition that form is active --> | ||
- form{"name": null} | ||
- slot{"requested_slot": null} | ||
- action_stop_q_form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
>> rule 1 | ||
- form{"name": "loop_q_form"} <!-- condition that form is active--> | ||
- slot{"requested_slot": "some_slot"} <!-- some condition --> | ||
- ... | ||
* inform{"some_slot":"bla"} <!-- can be ANY --> | ||
- loop_q_form <!-- can be internal core action, can be anything --> | ||
|
||
>> rule 2 | ||
- form{"name": "loop_q_form"} <!-- condition that form is active--> | ||
- slot{"requested_slot": "some_slot"} <!-- some condition --> | ||
- ... | ||
* explain <!-- can be anything --> | ||
- utter_explain_some_slot | ||
- loop_q_form | ||
- form{"name": "loop_q_form"} <!-- condition that form is active--> | ||
|
||
## ML story 1 | ||
* greet | ||
- utter_greet | ||
* request_restaurant | ||
- restaurant_form | ||
- form{"name": "restaurant_form"} | ||
- form{"name": null} | ||
- utter_slots_values | ||
* thankyou | ||
- utter_noworries | ||
|
||
>> rule 3 | ||
- form{"name": "loop_q_form"} <!-- condition that form is active--> | ||
- ... | ||
- loop_q_form <!-- condition that form is active --> | ||
- form{"name": null} | ||
- slot{"requested_slot": null} | ||
- action_stop_q_form | ||
|
||
## ML story 2 | ||
* greet | ||
- utter_greet | ||
* request_restaurant | ||
- restaurant_form | ||
- form{"name": "restaurant_form"} | ||
* chitchat | ||
- utter_chitchat | ||
- restaurant_form | ||
- form{"name": null} | ||
- utter_slots_values | ||
* thankyou | ||
- utter_noworries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
! | ||
[dasdassd, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
rules: | ||
- rule: rule 1 | ||
steps: | ||
- form: loop_q_form | ||
- slot: requested_slot | ||
value: some_slot | ||
- ... | ||
- intent: inform | ||
entities: | ||
- some_slot: bla | ||
- action: loop_q_form | ||
|
||
- rule: rule 2 | ||
steps: | ||
- form: loop_q_form | ||
- slot: requested_slot | ||
value: some_slot | ||
- ... | ||
- intent: explain | ||
- action: utter_explain_some_slot | ||
- action: loop_q_form | ||
- form: loop_q_form | ||
|
||
- rule: rule 3 | ||
steps: | ||
- form: loop_q_form | ||
- ... | ||
- form: null | ||
- slot: null | ||
- action: stop_q_form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
rules: | ||
- rule: rule 1 | ||
steps: | ||
- form: loop_q_form | ||
- slot: requested_slot | ||
value: some_slot | ||
- ... | ||
- intent: inform | ||
entities: | ||
- some_slot: bla | ||
- action: loop_q_form | ||
|
||
- rule: rule 2 | ||
steps: | ||
- form: loop_q_form | ||
- slot: requested_slot | ||
value: some_slot | ||
- ... | ||
- intent: explain | ||
- action: utter_explain_some_slot | ||
- action: loop_q_form | ||
- form: loop_q_form | ||
|
||
- rule: rule 3 | ||
steps: | ||
- form: loop_q_form | ||
- ... | ||
- form: null | ||
- slot: null | ||
- action: stop_q_form | ||
|
||
stories: | ||
- story: simple_story_without_checkpoint | ||
steps: | ||
- intent: simple | ||
- action: utter_default | ||
- action: utter_greet | ||
|
||
- story: simple_story_with_only_start | ||
steps: | ||
- checkpoint: check_greet # checkpoints at the start define entry points | ||
- intent: simple | ||
- action: utter_default | ||
|
||
- story: simple_story_with_only_end | ||
steps: | ||
- intent: hello | ||
- action: utter_greet | ||
- slot: name | ||
value: peter | ||
- checkpoint: check_greet # checkpoint defining the end of this turn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.