# Fallback

**URL:** <https://forum.rasa.com/t/fallback/3452>\
**Category:** Rasa Open Source\
**Created:** [December 12, 2018, 8:31am UTC](https://forum.rasa.com/t/fallback/3452 "2018-12-12T08:31:56Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![aby09](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/aby09/32/2018_2.png) [@aby09](https://forum.rasa.com/u/aby09)\
**Post date:** [December 12, 2018, 8:31am UTC](https://forum.rasa.com/t/fallback/3452/1 "2018-12-12T08:31:56Z")

</div>

Is there any example on fallback actions ??

---

<div class="post-metadata">

**Author:** ![Juste](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/juste/32/15_2.png) [@Juste](https://forum.rasa.com/u/Juste)\
**Post date:** [December 17, 2018, 11:11am UTC](https://forum.rasa.com/t/fallback/3452/2 "2018-12-17T11:11:34Z")

</div>

Hey @aby09. We have an example of implementation on the docs [Fallback Actions](https://rasa.com/docs/core/fallbacks/). In addition to that, you can check out Sara, the demo bot which uses fallback policy as well: [GitHub - RasaHQ/rasa-demo: Sara - the Rasa Demo Bot: An example of a contextual AI assistant built with the open source Rasa Stack](https://github.com/RasaHQ/rasa-demo)

---

<div class="post-metadata">

**Author:** ![aby09](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/aby09/32/2018_2.png) [@aby09](https://forum.rasa.com/u/aby09)\
**Post date:** [December 18, 2018, 11:29am UTC](https://forum.rasa.com/t/fallback/3452/3 "2018-12-18T11:29:16Z")

</div>

okay i ll check out SARA … thank you

---

<div class="post-metadata">

**Author:** ![aby09](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/aby09/32/2018_2.png) [@aby09](https://forum.rasa.com/u/aby09)\
**Post date:** [December 18, 2018, 11:46am UTC](https://forum.rasa.com/t/fallback/3452/4 "2018-12-18T11:46:26Z")

</div>

- name: TwoStageFallbackPolicy

how to set threshold value for nlu and core to get right answers ?

trial and error method or any other methods?

---

<div class="post-metadata">

**Author:** ![NikhilBansal21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nikhilbansal21/32/418_2.png) [@NikhilBansal21](https://forum.rasa.com/u/NikhilBansal21)\
**Post date:** [December 18, 2018, 12:55pm UTC](https://forum.rasa.com/t/fallback/3452/5 "2018-12-18T12:55:45Z")

</div>

you can mention threshold in your core or nlu training scripts like this

> fallback = FallbackPolicy(fallback\_action\_name=“action\_fallback”, core\_threshold=0.2, nlu\_threshold=0.3)
> 
> agent = Agent(‘domain\_dialogue.yml’, policies=[MemoizationPolicy(), KerasPolicy(), fallback])

and pass the fallback in your agent with other policies like above

---

<div class="post-metadata">

**Author:** ![aby09](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/aby09/32/2018_2.png) [@aby09](https://forum.rasa.com/u/aby09)\
**Post date:** [December 19, 2018, 5:33am UTC](https://forum.rasa.com/t/fallback/3452/6 "2018-12-19T05:33:41Z")

</div>

how to set value ?

---

<div class="post-metadata">

**Author:** ![NikhilBansal21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nikhilbansal21/32/418_2.png) [@NikhilBansal21](https://forum.rasa.com/u/NikhilBansal21)\
**Post date:** [December 19, 2018, 6:33am UTC](https://forum.rasa.com/t/fallback/3452/7 "2018-12-19T06:33:17Z")

</div>

what value?

---

<div class="post-metadata">

**Author:** ![NikhilBansal21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nikhilbansal21/32/418_2.png) [@NikhilBansal21](https://forum.rasa.com/u/NikhilBansal21)\
**Post date:** [December 19, 2018, 6:33am UTC](https://forum.rasa.com/t/fallback/3452/8 "2018-12-19T06:33:51Z")

</div>

> [@NikhilBansal21](#):
>
> fallback = FallbackPolicy(fallback\_action\_name=“action\_fallback”, core\_threshold=0.2, nlu\_threshold=0.3)

if you are talking about confidence value then its like that

---

<div class="post-metadata">

**Author:** ![aby09](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/aby09/32/2018_2.png) [@aby09](https://forum.rasa.com/u/aby09)\
**Post date:** [December 19, 2018, 6:59am UTC](https://forum.rasa.com/t/fallback/3452/9 "2018-12-19T06:59:12Z")

</div>

how you came know that 0.2 and 0.3 are best values for ur chatbot ? i want that …

---

<div class="post-metadata">

**Author:** ![NikhilBansal21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nikhilbansal21/32/418_2.png) [@NikhilBansal21](https://forum.rasa.com/u/NikhilBansal21)\
**Post date:** [December 19, 2018, 9:44am UTC](https://forum.rasa.com/t/fallback/3452/10 "2018-12-19T09:44:00Z")

</div>

thats not for your chat bot… that config can be changed according your need… i added that for my own config… use some sense pls!

---

<div class="post-metadata">

**Author:** ![aby09](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/aby09/32/2018_2.png) [@aby09](https://forum.rasa.com/u/aby09)\
**Post date:** [December 19, 2018, 10:43am UTC](https://forum.rasa.com/t/fallback/3452/11 "2018-12-19T10:43:59Z")

</div>

dude i know that … after setting up threshold value i am not getting proper answers. So i am asking is there any method to know proper threshold value

---

<div class="post-metadata">

**Author:** ![NikhilBansal21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nikhilbansal21/32/418_2.png) [@NikhilBansal21](https://forum.rasa.com/u/NikhilBansal21)\
**Post date:** [December 19, 2018, 10:55am UTC](https://forum.rasa.com/t/fallback/3452/12 "2018-12-19T10:55:50Z")

</div>

i guess you are setting nlu threshold too high which pipeline you are using spacy or tensorflow??

---

<div class="post-metadata">

**Author:** ![aby09](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/aby09/32/2018_2.png) [@aby09](https://forum.rasa.com/u/aby09)\
**Post date:** [December 19, 2018, 11:10am UTC](https://forum.rasa.com/t/fallback/3452/13 "2018-12-19T11:10:53Z")

</div>

i am using spacy

---

<div class="post-metadata">

**Author:** ![rohanb456](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rohanb456](https://forum.rasa.com/u/rohanb456)\
**Post date:** [December 19, 2018, 11:29am UTC](https://forum.rasa.com/t/fallback/3452/14 "2018-12-19T11:29:46Z")

</div>

Even i faced the same problem, it was quite tiresome to frequently change the threshold values and again train the model so is there any relevant method to find a proper threshold value.

---

<div class="post-metadata">

**Author:** ![aby09](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/aby09/32/2018_2.png) [@aby09](https://forum.rasa.com/u/aby09)\
**Post date:** [December 19, 2018, 11:36am UTC](https://forum.rasa.com/t/fallback/3452/15 "2018-12-19T11:36:51Z")

</div>

even i am facing same problem …i guess you should do it manually

someone plz prove me wrong …😅

---

<div class="post-metadata">

**Author:** ![NikhilBansal21](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nikhilbansal21/32/418_2.png) [@NikhilBansal21](https://forum.rasa.com/u/NikhilBansal21)\
**Post date:** [December 19, 2018, 1:11pm UTC](https://forum.rasa.com/t/fallback/3452/16 "2018-12-19T13:11:29Z")

</div>

No you don’t have to change it everytime… See it depends on your training data… The nlu threshold you have entered is too high 0.8 is very high… do one think ill prefer changing your pipline to tensorflow… y tensorflow? cz tensorflow works good for intent classification with higher confidence with low training data as compared to spacy or mitie… you have to have the knowledge for correct pipelines in this domain and for that you can refer in the docs…They have a good collection for docs you just have to sit and go through for better understanding… I have right now many bots working on rasa NLU and Core and i didnt have to change the threshold for any of them…just train them properly and go through the pipeline functioning…

And by lower training data it doesn’t mean 5-10 phrases per intent… You still need at least 15-20 or max 25 for tensorflow and for spacy you need far more than that for better confidence

---

<div class="post-metadata">

**Author:** ![noman](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/noman/32/10071_2.png) [@noman](https://forum.rasa.com/u/noman)\
**Post date:** [September 25, 2019, 4:44pm UTC](https://forum.rasa.com/t/fallback/3452/17 "2019-09-25T16:44:22Z")

</div>

> [@NikhilBansal21](#):
>
> use some sense pls!

its unethical comment

---

<div class="post-metadata">

**Author:** ![akshayg11](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@akshayg11](https://forum.rasa.com/u/akshayg11)\
**Post date:** [February 6, 2020, 10:07am UTC](https://forum.rasa.com/t/fallback/3452/18 "2020-02-06T10:07:24Z")

</div>

@aby09 This blog might be of help to you in finding the apt NLU threshold. [https://blog.rasa.com/failing-gracefully-with-rasa-core/?\_ga=2.240287815.518918257.1580717424-419595417.1574159216](https://blog.rasa.com/failing-gracefully-with-rasa-core/?_ga=2.240287815.518918257.1580717424-419595417.1574159216)

---

<div class="post-metadata">

**Author:** ![ermarkar](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ermarkar/32/13716_2.png) [@ermarkar](https://forum.rasa.com/u/ermarkar)\
**Post date:** [March 10, 2021, 2:09pm UTC](https://forum.rasa.com/t/fallback/3452/19 "2021-03-10T14:09:55Z")

</div>

for version 2 it is not working using FallbackClassifier

i have added more details on

> <https://stackoverflow.com/questions/66558761/fall-back-policy-is-not-working-with-rasa-framework>
