Skip to content
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

Merged
merged 68 commits into from
Jul 10, 2020
Merged

Rules #6088

merged 68 commits into from
Jul 10, 2020

Commits on Apr 29, 2020

  1. add RulePolicy

    Ghostvv committed Apr 29, 2020
    Configuration menu
    Copy the full SHA
    f5d2122 View commit details
    Browse the repository at this point in the history

Commits on May 1, 2020

  1. add ... helper

    Ghostvv committed May 1, 2020
    Configuration menu
    Copy the full SHA
    8b9aafe View commit details
    Browse the repository at this point in the history

Commits on May 4, 2020

  1. Configuration menu
    Copy the full SHA
    46f9032 View commit details
    Browse the repository at this point in the history
  2. fix comment

    Ghostvv committed May 4, 2020
    Configuration menu
    Copy the full SHA
    1edf80b View commit details
    Browse the repository at this point in the history

Commits on May 6, 2020

  1. return padding

    Ghostvv committed May 6, 2020
    Configuration menu
    Copy the full SHA
    d079923 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2020

  1. fix states

    Ghostvv committed May 7, 2020
    Configuration menu
    Copy the full SHA
    07da429 View commit details
    Browse the repository at this point in the history

Commits on May 26, 2020

  1. Configuration menu
    Copy the full SHA
    210038b View commit details
    Browse the repository at this point in the history
  2. remove old 'EmbeddingPolicy

    wochinge committed May 26, 2020
    Configuration menu
    Copy the full SHA
    0200cfd View commit details
    Browse the repository at this point in the history

Commits on May 27, 2020

  1. Configuration menu
    Copy the full SHA
    474fc54 View commit details
    Browse the repository at this point in the history

Commits on May 28, 2020

  1. implement Forms with RulePolicy

    * 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>
    4 people authored May 28, 2020
    Configuration menu
    Copy the full SHA
    f8a7a34 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2020

  1. fix rule policy

    Ghostvv committed May 29, 2020
    Configuration menu
    Copy the full SHA
    79601f1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e274da8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    83e3c91 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1ac061d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5c5d859 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    da148ae View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    aa51fb2 View commit details
    Browse the repository at this point in the history
  8. Rules nlu fallback (#5911)

    * add NLU component to set fallback intent
    
    * add example rule for simple fallback
    
    * fix form test case
    wochinge authored May 29, 2020
    Configuration menu
    Copy the full SHA
    33c282b View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2020

  1. Configuration menu
    Copy the full SHA
    9247f0d View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2020

  1. RulePolicy: Abstract loop interface + TwoStageFallbackPolicy (#5933)

    * 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)
    wochinge authored Jun 13, 2020
    Configuration menu
    Copy the full SHA
    440ede7 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2020

  1. Configuration menu
    Copy the full SHA
    9301a57 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2020

  1. New Form featurization (#6029)

    * 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`
    wochinge authored Jun 23, 2020
    Configuration menu
    Copy the full SHA
    ff213fc View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2020

  1. Test added!

    alwx committed Jun 24, 2020
    Configuration menu
    Copy the full SHA
    afad45f View commit details
    Browse the repository at this point in the history
  2. Merge pull request #6030 from RasaHQ/rules-scope-dispatched-per-form

    RulePolicy: scope dispatches per form
    alwx authored Jun 24, 2020
    Configuration menu
    Copy the full SHA
    bed6aeb View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2020

  1. remove form unfeaturization, fix rules prediction (#6068)

    * 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>
    Ghostvv and wochinge authored Jun 25, 2020
    Configuration menu
    Copy the full SHA
    2c65b10 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2020

  1. Configuration menu
    Copy the full SHA
    5f0f30f View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2020

  1. Configuration menu
    Copy the full SHA
    650d49c View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2020

  1. Configuration menu
    Copy the full SHA
    351517e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    607e1e4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    51c5ff2 View commit details
    Browse the repository at this point in the history
  4. remove one-line fn

    ricwo committed Jul 3, 2020
    Configuration menu
    Copy the full SHA
    d1f56cd View commit details
    Browse the repository at this point in the history
  5. remove debug line

    ricwo committed Jul 3, 2020
    Configuration menu
    Copy the full SHA
    08db056 View commit details
    Browse the repository at this point in the history
  6. fix lint stage

    ricwo committed Jul 3, 2020
    Configuration menu
    Copy the full SHA
    97e18b9 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2020

  1. update docstring

    ricwo committed Jul 5, 2020
    Configuration menu
    Copy the full SHA
    1850fd5 View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2020

  1. Apply suggestions from code review

    Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>
    ricwo and wochinge authored Jul 7, 2020
    Configuration menu
    Copy the full SHA
    01e855c View commit details
    Browse the repository at this point in the history
  2. complete docstring

    ricwo committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    8caddd9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6143a05 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0e74e6a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3e7f2c2 View commit details
    Browse the repository at this point in the history
  6. update docstring

    ricwo committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    97fa683 View commit details
    Browse the repository at this point in the history
  7. merge rules

    ricwo committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    dc0c258 View commit details
    Browse the repository at this point in the history
  8. fix test data

    ricwo committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    c4f95e8 View commit details
    Browse the repository at this point in the history
  9. unused constants and typos

    ricwo committed Jul 7, 2020
    Configuration menu
    Copy the full SHA
    7db99a6 View commit details
    Browse the repository at this point in the history
  10. Merge pull request #6136 from RasaHQ/rules-yaml

    YAML rule and form support
    ricwo authored Jul 7, 2020
    Configuration menu
    Copy the full SHA
    0148e28 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2020

  1. fix breaking tests in rules branch (#6097)

    * adapt test to new form featurization
    
    * skip 'action_session_start' when serializing story
    
    * fix form rejection emulation for RulePolicy
    
    * both RulePolicy and FormPolicy fulfill the requirement for forms in the domain
    
    * add more types
    
    * fix default max history for RulePolicy
    
    * introduce default actions which can overrule rules
    
    * fix form evaluation tests
    
    * add typing for 'active_loop'
    
    * make type explicit for pytype
    
    * re-add FormPolicy tests
    
    * adapt to new default actions
    
    * fix form featurization logic
    
    The `TestFormPolicy` test which uses the test stories `data/test_stories/stories_form.md` failed previously. The issue was that `applied_events` didn't recognize unhappy paths correctly. Now we assume we are in an unhappy path in case different actions run a user utterance without a form action in between.
    
    * move validation for form policy to `Ensemble`
    
    * don't undo emulation of form rejection
    
    * invert if logic
    
    * add check to avoid RulePolicy usage with other rule-like policies
    
    * add missing FormPolicy import
    
    * fix StoryReader import
    
    * remove unused functions
    
    * some more form action tests
    wochinge authored Jul 8, 2020
    Configuration menu
    Copy the full SHA
    6f6770a View commit details
    Browse the repository at this point in the history

Commits on Jul 9, 2020

  1. Configuration menu
    Copy the full SHA
    618bbac View commit details
    Browse the repository at this point in the history
  2. preserve key order when dumping YAML (#6168)

    * preserve key order when dumping YAML
    
    * remove debug lines
    
    * improve import
    
    * fix converter
    
    * switch on flag in domain.py
    
    * no special handling for sets
    
    * accept not just dicts
    
    * add test for non-dict types
    ricwo authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    6d60ca5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    151d213 View commit details
    Browse the repository at this point in the history
  4. expand comment in RulePolicy

    Ghostvv committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    78cf134 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2f6cb17 View commit details
    Browse the repository at this point in the history
  6. have one validate function for the whole form (#6171)

    * have one validate function for the whole form
    
    * remove unused function
    
    * more tests
    
    * remove unnecessary ignores
    
    * add clarification comment
    
    * validate user input in activation (#6172)
    
    * validate user input in activation
    
    Co-authored-by: Tobias Wochinger <t.wochinger@rasa.com>
    
    * more tests for entity extraction
    
    * more `FormAction` tests
    
    * add todo
    
    Co-authored-by: Vladimir Vlasov <vladimir@rasa.com>
    wochinge and Ghostvv authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    b64cece View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d60c5b2 View commit details
    Browse the repository at this point in the history
  8. remove unused constant

    wochinge committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    c4936b0 View commit details
    Browse the repository at this point in the history
  9. return only to make code more readable

    Co-authored-by: Tanja <tabergma@gmail.com>
    wochinge and tabergma authored Jul 9, 2020
    Configuration menu
    Copy the full SHA
    2c993b7 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a942cf6 View commit details
    Browse the repository at this point in the history
  11. use f-strings

    wochinge committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    0f827fa View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    9065291 View commit details
    Browse the repository at this point in the history
  13. rename 'evts' to '_events'

    wochinge committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    3a7d6f6 View commit details
    Browse the repository at this point in the history
  14. add missing types

    wochinge committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    4927007 View commit details
    Browse the repository at this point in the history
  15. remove whitespace

    wochinge committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    3edbfee View commit details
    Browse the repository at this point in the history
  16. make return type explicit

    wochinge committed Jul 9, 2020
    Configuration menu
    Copy the full SHA
    4a08f34 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6fb55a5 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    df9b595 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2020

  1. Configuration menu
    Copy the full SHA
    988e2ea View commit details
    Browse the repository at this point in the history
  2. Rules feedback (#6177)

    * 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
    wochinge authored Jul 10, 2020
    Configuration menu
    Copy the full SHA
    64ca4a0 View commit details
    Browse the repository at this point in the history
  3. fix typos

    Co-authored-by: Tanja <tabergma@gmail.com>
    wochinge and tabergma authored Jul 10, 2020
    Configuration menu
    Copy the full SHA
    1de450d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5ad7aae View commit details
    Browse the repository at this point in the history
  5. don't mix strip and slicing

    wochinge committed Jul 10, 2020
    Configuration menu
    Copy the full SHA
    3cb9b5f View commit details
    Browse the repository at this point in the history