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

Made use of drop-small-last-batch logic only possible in DIET and configurable #12948

Merged
merged 3 commits into from Nov 16, 2023

Conversation

twerkmeister
Copy link
Contributor

@twerkmeister twerkmeister commented Nov 13, 2023

Proposed changes:

  • added config var for "drop small last batch" for DIET which is off by default and results in the original batching logic
  • turned off the logic permanently for TED- and UnexpecTEDIntentPolicy
  • added tests that batching logic reacts to the parameter
  • did not add test for UnexpecTEDIntentPolicy not failing because it was way to complex to create the needed precomputation objects to really simulate a full training. In a naive test the policy did not fail at all. Reproduced the error locally as follows and confirmed that it is now gone

Error reproduction

  • initialize a new bot repo using rasa init
  • add UnexpecTEDIntentPolicy to the policies, with batch size 5
  • remove rules
  • replace stories.yml with the yml below containing 12 stories that will lead to two being dropped with batch size 5 and triggering the problem
  • run rasa train --force with and without the changes

Stories

version: "3.1"

stories:

- story: happy path
  steps:
  - intent: greet
  - action: utter_greet
  - intent: mood_great
  - action: utter_happy

- story: sad path 1
  steps:
  - intent: greet
  - action: utter_greet
  - intent: mood_unhappy
  - action: utter_cheer_up
  - action: utter_did_that_help
  - intent: affirm
  - action: utter_happy

- story: sad path 2
  steps:
  - intent: greet
  - action: utter_greet
  - intent: mood_unhappy
  - action: utter_cheer_up
  - action: utter_did_that_help
  - intent: deny
  - action: utter_goodbye

- story: Say goodbye anytime the user says goodbye
  steps:
  - intent: goodbye
  - action: utter_goodbye

- story: Say 'I am a bot' anytime the user challenges
  steps:
  - intent: bot_challenge
  - action: utter_iamabot

- story: x
  steps:
  - intent: goodbye
  - action: utter_goodbye
  - intent: bot_challenge
  - action: utter_iamabot

- story: happy path w goodbye
  steps:
  - intent: greet
  - action: utter_greet
  - intent: mood_great
  - action: utter_happy
  - intent: goodbye 
  - action: utter_goodbye

- story: sad path w goodbye
  steps:
  - intent: greet
  - action: utter_greet
  - intent: mood_unhappy
  - action: utter_cheer_up
  - action: utter_did_that_help
  - intent: affirm
  - action: utter_happy
  - intent: goodbye
  - action: utter_goodbye

- story: sad path 2 w goodbye
  steps:
  - intent: greet
  - action: utter_greet
  - intent: mood_unhappy
  - action: utter_cheer_up
  - action: utter_did_that_help
  - intent: deny
  - action: utter_goodbye
  - intent: goodbye
  - action: utter_goodbye

- story: happy path w bot challenge
  steps:
  - intent: greet
  - action: utter_greet
  - intent: bot_challenge
  - action: utter_iamabot
  - intent: mood_great
  - action: utter_happy

- story: sad path 1 w bot challenge
  steps:
  - intent: greet
  - action: utter_greet
  - intent: bot_challenge
  - action: utter_iamabot
  - intent: mood_unhappy
  - action: utter_cheer_up
  - action: utter_did_that_help
  - intent: affirm
  - action: utter_happy

- story: sad path 2 w bot challenge
  steps:
  - intent: greet
  - action: utter_greet
  - intent: bot_challenge
  - action: utter_iamabot
  - intent: mood_unhappy
  - action: utter_cheer_up
  - action: utter_did_that_help
  - intent: deny
  - action: utter_goodbye

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@twerkmeister twerkmeister requested a review from a team as a code owner November 13, 2023 12:18
Copy link
Contributor

🚀 A preview of the docs have been deployed at the following URL: https://12948--rasahq-docs-rasa-v2.netlify.app/docs/rasa

Copy link
Member

@tmbo tmbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@twerkmeister twerkmeister merged commit 58e122f into 3.6.x Nov 16, 2023
98 of 99 checks passed
@twerkmeister twerkmeister deleted the ENG-635-drop-last-batch-fix branch November 16, 2023 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants