Fallback implementation in new version

Hi , I am using new version 0.11.3, I am trying to enable fallback policy through rasa core train command. The below is my command

python -m rasa_core.train -s stories.md -d domain.yml -o models/dialogue --history 1 --nlu_threshold 0.1 --core_threshold 0.1 --fallback_action action_default_fallback --epochs 300

I have mentioned the utter_default template in domain.yml file and in stories defined like this

    ## fallback
- action_default_fallback

when checking with some random words i am getting the below error. Please help me to resolve

`2018-09-10 15:50:00 DEBUG rasa_core.tracker_store - Creating a new tracker for id ā€˜defaultā€™. 2018-09-10 15:50:00 DEBUG rasa_core.processor - Received user message ā€˜give me kickā€™ with intent ā€˜{ā€˜nameā€™: None, ā€˜confidenceā€™: 0.0}ā€™ and entities ā€˜[]ā€™ 2018-09-10 15:50:00 DEBUG rasa_core.processor - Logged UserUtterance - tracker now has 2 events 2018-09-10 15:50:00 DEBUG rasa_core.processor - Current slot values:

2018-09-10 15:50:00 DEBUG rasa_core.policies.fallback - NLU confidence 0.0 is lower than NLU threshold 0.1. Predicting fallback action: action_default_fallback 2018-09-10 15:50:00 DEBUG rasa_core.policies.memoization - Current tracker state [{ā€˜prev_action_listenā€™: 1.0}] 2018-09-10 15:50:00 DEBUG rasa_core.policies.memoization - There is no memorised next action 2018-09-10 15:50:00 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_0_FallbackPolicy 2018-09-10 15:50:00 DEBUG rasa_core.processor - Predicted next action ā€˜action_default_fallbackā€™ with prob 1.00. 2018-09-10 15:50:00 ERROR rasa_core.processor - Encountered an exception while running action ā€˜action_default_fallbackā€™. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code. 2018-09-10 15:50:00 ERROR rasa_core.processor - The model predicted the custom action ā€˜action_default_fallbackā€™ but you didnā€™t configure an endpoint to run this custom action. Please take a look at the docs and set an endpoint configuration. https://rasa.com/docs/core/customactions/`

Please correct me if i am missing any steps?

Someone please help me on this issue

The fall back action is default action,suppose if you want use it in your bot. This will be treated as custom action, so copy the fall back implementation and create the actions.py. On the next step run this below command

python -m rasa_core_sdk.endpoint --actions actions

to treat your custom action as endpoint. Mention the endpoint.yml file in the rasa core run command.

you donā€™t need to copy the fallback action, just donā€™t list it in your domain, and then it should run fine with the command you specified

Thanks @akelad it worked.

@akelad i will add this step in the docs and share the PR

1 Like

hmm iā€™m pretty sure this is already in the docs?

Hi, can I know from which version of rasa_core the fallback policy is applicable. I am currently using rasa_core of 0.9.0a2 version. when i tried to include the fallback policy, while I am trying to train rasa_core model it is running fine but when I am running the bot on cmdline it is throwing the following error : ā€œTypeError: load() takes 2 positional arguments but 4 were givenā€. Please help me to resolve this issue. Thank you in advance.