Skip to content

Commit

Permalink
Merge branch 'master' into docs-links-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
erohmensing authored Sep 15, 2020
2 parents 383cfda + 302825e commit 443430a
Show file tree
Hide file tree
Showing 13 changed files with 361 additions and 455 deletions.
42 changes: 42 additions & 0 deletions docs/docs/policies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,48 @@ a fixed behavior. It makes predictions based on any `rules` you have in your
training data. See the [Rules documentation](./rules.mdx) for further information
on how to define rules.

The RulePolicy has the following configuration options:

```yaml title="config.yml"
policies:
- name: "RulePolicy"
core_fallback_threshold: 0.3
core_fallback_action_name: action_default_fallback
enable_fallback_prediction: true
restrict_rules: true
check_for_contradictions: true
```

* `core_fallback_threshold` (default: `0.3`): Please see the
[fallback documentation](fallback-handoff.mdx#handling-low-core-confidence) for
further information.
* `core_fallback_action_name` (default: `action_default_fallback`): Please see the
[fallback documentation](fallback-handoff.mdx#handling-low-core-confidence) for
further information.
* `enable_fallback_prediction` (default: `true`): Please see the
[fallback documentation](fallback-handoff.mdx#handling-low-core-confidence) for
further information.
* `check_for_contradictions` (default: `true`): After training, the RulePolicy will
perform a check to make sure that there are no rules that contradict with each other, or with any stories.
The following snippet is an example for two contradicting rules:

```yaml-rasa
rules:
- rule: Chitchat
steps:
- intent: chitchat
- action: utter_chitchat
- rule: Greet instead of chitchat
steps:
- intent: chitchat
- action: utter_greet # `utter_greet` contradicts `utter_chitchat` from the rule above
```
* `restrict_rules` (default: `true`): Rules are restricted to one user turn, but
there can be multiple bot events, including e.g. a form being filled and its
Change this parameter to `false` at your own risk.
Overusing rules for purposes outside of the [recommended use cases](rules.mdx)
will make it very hard to maintain your assistant as the complexity grows.

## Configuring Policies

Expand Down
18 changes: 8 additions & 10 deletions examples/rules/data/rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ rules:
# Don't predict `action_listen` after running `utter_faq`
wait_for_user_input: False

- rule: Detailed FAQ did not help - continue
- rule: Detailed FAQ did not help
condition:
- slot_was_set:
- detailed_faq: true
Expand All @@ -98,21 +98,19 @@ rules:
- action: utter_ask_did_help
- intent: deny
- action: utter_ask_stop
- intent: deny
- action: utter_continue

- rule: Detailed FAQ did not help - stop
condition:
- slot_was_set:
- detailed_faq: true
- rule: User decides to stop
steps:
- action: utter_detailed_faq
- action: utter_ask_did_help
- intent: deny
- action: utter_ask_stop
- intent: affirm
- action: utter_stop

- rule: User decides to continue
steps:
- action: utter_ask_stop
- intent: deny
- action: utter_continue

- rule: Implementation of the TwoStageFallbackPolicy
steps:
# This intent is automatically triggered by the `FallbackClassifier` in the NLU
Expand Down
306 changes: 0 additions & 306 deletions examples/rules/rules_markdown/nlu.md

This file was deleted.

Loading

0 comments on commit 443430a

Please sign in to comment.