-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rules #6088
Conversation
* add sdk form * adapt form from SDK to Rasa * load form action & slot mappings dynamically from domain * add simple test for RulePolicy * remove old 'EmbeddingPolicy * trigger form using default rules * split stories into ML and rules * remove warnings * handle form unhappy paths with RulePolicy * add `...` to default actions * fix error when converting domain forms to dict * update rule symbol to '>>' and fix data generation * update tqdm desc * fixes for forms in domain * make function to remove predictions more general * omit activation events for forms when deactivating immediately * adapt rule examples to implementation * add `is_rule_tracker=True` to tests * match rule pattern in story file * add test for immediate submit * simplify form prediction * remove unused imports * FormAction now asks for slot * unfeaturize `requested_slot` * fix form submit rule * implement review comments * polish - add todos - more tests - more comments * remove unused variable * remove print * Update examples/rules/data/stories.md * fix max_history error * check if featurizer is not None as well * uncomment slack * add missing events to rules example * update test stories to changed logic * fix more tests * comment extracting other slots from arbitrary entity Co-authored-by: ricwo <ric.wkr@gmail.com> Co-authored-by: ricwo <20581300+ricwo@users.noreply.github.com> Co-authored-by: Vova Vv <mr.voov@gmail.com>
* add NLU component to set fallback intent * add example rule for simple fallback * fix form test case
* implement abstract loop interface * adapt `FormAction` to new `loop` interface * add `TwoStageFallbackAction` * add todo for renaming `active_form` * make NLU fallback intent a hardcoded intent name It has to be hardcoded since the TwoStageFallbackPolicy relies on it's name, similar to the out of scope intent name * rename to `loops` (plural)
* implement form unfeaturization * rename `active_form` to `active_loop` * adapt tests for rule policy * use existing `REQUESTED_SLOT` constant * use full EventVerbosity in TwoStageFallbackAction * nuke FormPolicy test The `FormPolicy` will be removed in favor of the `RulePolicy` so no need to fix / adapt the tests here. * fix ` Duplicate actions in domain` in `rasa interactive`
RulePolicy: scope dispatches per form
* remove form unfeaturization, fix rules * rename variable * add validation false event * remove unneeded method * Update examples/formbot/data/stories.md Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com> * add comments and clean rule policy * Update rasa/core/policies/rule_policy.py Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com> * Update rasa/core/policies/rule_policy.py Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com> * Update rasa/core/policies/rule_policy.py Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com> * Update rasa/core/policies/rule_policy.py Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com> * black * Update rasa/core/policies/rule_policy.py Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com> * Update rasa/core/policies/rule_policy.py Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com> * fix code quality Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>
Co-authored-by: Tanja <tabergma@gmail.com>
* deprecate old rule-like policies * only run `FormAction` if users defined a slot mapping for the form in the domain * remove Todo as TwoStageFallbackPolicy is deprecated anyway * make it a module function as it has no self reference * translate rule examples to yaml * fix slot warning * add explanation comment to `FallbackClassifier` * add changelog * Don't try to generate stories if no StorySteps given * disable warnings about default intents when RulePolicy is available * fix test for invalid yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took another brief look. Code wise it looks great. Good job 🚀
@Ghostvv Tanja's new feedback is implemented. Are we ready to merge? :drum_roll: 🤩 |
Tanja has to give us green flag 😇. I can approve, but it'll be cheating PR review😜 |
You care about cheating at this point? 😄 Let me quickly create another GitHub account ... 🤣 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥁 💯
Proposed changes:
RulePolicy
FormAction
from SDK to Rasa Open SourceMappingPolicy
,TwoStageFallbackPolicy
,FallbackPolicy
,FormPolicy
)TwoStageFallbackPolicy
as actionFallbackClassifier
which predicts an intentnlu_fallback
in case the confidence of the other intents is below a given threshold. This allows to write stories which handle low nlu confidenceForm
s. Happy paths are now represented as a single event.Follow up issue: #6176
Status (please check what you already did):
black
(please check Readme for instructions)