# Rasa X not given correct actions for properly detected intents

**URL:** <https://forum.rasa.com/t/rasa-x-not-given-correct-actions-for-properly-detected-intents/29932>\
**Category:** Rasa Open Source\
**Created:** [June 8, 2020, 1:20pm UTC](https://forum.rasa.com/t/rasa-x-not-given-correct-actions-for-properly-detected-intents/29932 "2020-06-08T13:20:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Purbasha10](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@Purbasha10](https://forum.rasa.com/u/Purbasha10)\
**Post date:** [June 8, 2020, 1:20pm UTC](https://forum.rasa.com/t/rasa-x-not-given-correct-actions-for-properly-detected-intents/29932/1 "2020-06-08T13:20:19Z")

</div>

Rasa X is detecting the intents properly however not giving the actions appropriate to those intents and rather giving default fallback action. For eg. intent appointment should respond with utter\_appointment however giving default\_fallback\_action.

Can anyone help me in this regard?

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [June 9, 2020, 12:15pm UTC](https://forum.rasa.com/t/rasa-x-not-given-correct-actions-for-properly-detected-intents/29932/2 "2020-06-09T12:15:45Z")

</div>

hi @Purbasha10 - welcome to the forum!

Rasa X does not influence how what predictions Rasa Open Source is making, so you should be able to reproduce this behaviour when running `rasa shell`, too.

If you are getting a fallback action, it could be that the confidence threshold is set too high.

> **[Fallback and Human Handoff](https://rasa.com/docs/rasa/fallback-handoff/#fallbacks)**

Do you have the fallback policy in your config.yml ?

---

<div class="post-metadata">

**Author:** ![Purbasha10](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@Purbasha10](https://forum.rasa.com/u/Purbasha10)\
**Post date:** [June 11, 2020, 5:29am UTC](https://forum.rasa.com/t/rasa-x-not-given-correct-actions-for-properly-detected-intents/29932/3 "2020-06-11T05:29:16Z")

</div>

I had set the nlu\_threshold to 0.4 and core\_threshold to 0.3. Yes I had included the fallback policy in the config file. However, since it was giving fallback action for almost every query, I have removed the default fallback action from all the files(config, domain, nlu and stories). However now it is detecting the intents properly but giving response of other intents. Screenshot below. Intent is proper(payment\_mode) but response in utter\_pat\_marketplace\_subscriptiondeal.

 ![Screen Shot 2020-06-11 at 10.56.54 AM](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/0/00a55f47d2a028dcd822f5bcdf91fac5530856f1.png)

---

<div class="post-metadata">

**Author:** ![amn41](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/amn41/32/20_2.png) [@amn41](https://forum.rasa.com/u/amn41)\
**Post date:** [June 11, 2020, 6:26am UTC](https://forum.rasa.com/t/rasa-x-not-given-correct-actions-for-properly-detected-intents/29932/4 "2020-06-11T06:26:03Z")

</div>

hi @Purbasha10 You can try runnnig this in the command line with `rasa shell --debug`, that should give some helpful info about why the wrong action is being predicted.

However, if these are FAQs which always receive the same answer, you may want to use [retrieval actions](https://rasa.com/docs/rasa/core/retrieval-actions/#id1) or the mapping policy.

---

<div class="post-metadata">

**Author:** ![ganeshv](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ganeshv/32/4644_2.png) [@ganeshv](https://forum.rasa.com/u/ganeshv)\
**Post date:** [June 11, 2020, 6:57am UTC](https://forum.rasa.com/t/rasa-x-not-given-correct-actions-for-properly-detected-intents/29932/5 "2020-06-11T06:57:04Z")

</div>

@amn41 - I think this might be related to this [one](http://forum.rasa.com/t/training-was-completely-overhauled-after-a-few-minor-changes-in-actions-py-and-a-version-upgrade/30011). I had a similar outcome where upon trying it in `rasa interactive`, I get the right actions.

But when I deployed it to production and also viewed it inside Rasa X, it was going to the fallback action literally every time, even when I only triggered the intent to load the slots with metadata and did not pass the user’s message.

---

<div class="post-metadata">

**Author:** ![Purbasha10](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@Purbasha10](https://forum.rasa.com/u/Purbasha10)\
**Post date:** [June 11, 2020, 7:38am UTC](https://forum.rasa.com/t/rasa-x-not-given-correct-actions-for-properly-detected-intents/29932/6 "2020-06-11T07:38:17Z")

</div>

How does the mapping policy work exactly? I referred to the documentation and included triggers in the domain file as below:

- telemedicine\_types: triggers: utter\_telemedicine\_types
- telemedicine\_how: triggers: utter\_telemedicine\_how
- telemedicine\_helphow
- telemedicine\_livenow: triggers: utter\_telemedicine\_livenow

I have added proper indentation to the triggers line however while i do rasa train after the new domain file it gives the below error:

Traceback (most recent call last): File “/home/ubuntu/anaconda3/bin/rasa”, line 8, in sys.exit(main()) File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/ **main**.py”, line 91, in main cmdline\_arguments.func(cmdline\_arguments) File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/cli/train.py”, line 76, in train additional\_arguments=extract\_additional\_arguments(args), File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/train.py”, line 50, in train additional\_arguments=additional\_arguments, File “uvloop/loop.pyx”, line 1456, in uvloop.loop.Loop.run\_until\_complete File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/train.py”, line 88, in train\_async domain = await file\_importer.get\_domain() File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/importers/importer.py”, line 242, in get\_domain domains = await asyncio.gather(\*domains) File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/importers/rasa.py”, line 66, in get\_domain domain = Domain.load(self.\_domain\_path) File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/core/domain.py”, line 100, in load other = cls.from\_path(path) File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/core/domain.py”, line 110, in from\_path domain = cls.from\_file(path) File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/core/domain.py”, line 123, in from\_file return cls.from\_yaml(rasa.utils.io.read\_file(path)) File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/core/domain.py”, line 133, in from\_yaml return cls.from\_dict(data) File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/core/domain.py”, line 162, in from\_dict \*\*additional\_arguments, File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/core/domain.py”, line 413, in **init** self.intent\_properties = self.collect\_intent\_properties(intents, entities) File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/core/domain.py”, line 349, in collect\_intent\_properties intent = cls.\_transform\_intent\_properties\_for\_internal\_use(intent, entities) File “/home/ubuntu/anaconda3/lib/python3.7/site-packages/rasa/core/domain.py”, line 290, in \_transform\_intent\_properties\_for\_internal\_use properties.setdefault(USE\_ENTITIES\_KEY, True) AttributeError: ‘NoneType’ object has no attribute ‘setdefault’
