# Using custom entities in nlu gives default fallback

**URL:** <https://forum.rasa.com/t/using-custom-entities-in-nlu-gives-default-fallback/58984>\
**Category:** Rasa Open Source\
**Created:** [July 12, 2023, 8:52am UTC](https://forum.rasa.com/t/using-custom-entities-in-nlu-gives-default-fallback/58984 "2023-07-12T08:52:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![karan-0603](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/karan-0603/32/23146_2.png) [@karan-0603](https://forum.rasa.com/u/karan-0603)\
**Post date:** [July 12, 2023, 8:52am UTC](https://forum.rasa.com/t/using-custom-entities-in-nlu-gives-default-fallback/58984/1 "2023-07-12T08:52:40Z")

</div>

- intent: provided\_category/social\_network examples: |
  - I’m looking for an [social networking]{“entity”:“app\_category”,“value”:“Social Networking”} app
  - Can you help me with a [social networking]{“entity”:“app\_category”,“value”:“Social Networking”} app?
  - I need assistance with an [social networking]{“entity”:“app\_category”,“value”:“Social Networking”} app
  - Is it possible to create a [social networking]{“entity”:“app\_category”,“value”:“Social Networking”} app?
  - I want to build a [social networking]{“entity”:“app\_category”,“value”:“Social Networking”} app
  - Do you develop [social networking]{“entity”:“app\_category”,“value”:“Social Networking”} apps?
  - Can you create an [social networking]{“entity”:“app\_category”,“value”:“Social Networking”} app?
  - I’m interested in a [social networking]{“entity”:“app\_category”,“value”:“Social Networking”} app
  - Could you build a [social networking]{“entity”:“app\_category”,“value”:“Social Networking”} app?
  - I want to develop a [social networking]{“entity”:“app\_category”,“value”:“Social Networking”} app
  - Is it possible to create a [social networking]{“entity”:“app\_category”,“value”:“Social Networking”} app?

\*\* This is my nlu data to get intent and to extract entity app category \*\*

- story: User selects native app development steps:
  - intent: native\_app\_development
  - action: action\_native\_app\_development
  - action: utter\_native\_app\_development\_selection
  - intent: android\_development
  - action: utter\_select\_app\_category\_desc
  - action: action\_set\_slot\_native\_development\_type
  - intent: provided\_category
  - action: action\_set\_selected\_app\_category

this is my story

when I don’t use entity in nlu data the flow works fine but when i use the custom entity ( as provided above ) its detecting the intent correct but it does not continue the story and goes direct to action\_defaul\_fallback intent

```plaintext
[state 1] user intent: mobile_development | previous action name: action_listen
[state 2] user intent: mobile_development | previous action name: utter_mobile_development_desc
[state 3] user intent: mobile_development | previous action name: action_mobile_development
[state 4] user intent: native_app_development | previous action name: action_listen
[state 5] user intent: native_app_development | previous action name: action_native_app_development
[state 6] user intent: native_app_development | previous action name: utter_native_app_development_selection
[state 7] user intent: android_development | previous action name: action_listen
[state 8] user intent: android_development | previous action name: utter_select_app_category_desc
[state 9] user intent: android_development | previous action name: action_set_slot_native_development_type
[state 10] user intent: provided_category | user entities: ('app_category',) | previous action name: action_listen
2023-07-12 14:10:22 DEBUG rasa.core.policies.rule_policy - There is no applicable rule.
2023-07-12 14:10:22 DEBUG rasa.engine.graph - Node 'select_prediction' running 'DefaultPolicyPredictionEnsemble.combine_predictions_from_kwargs'.
2023-07-12 14:10:22 DEBUG rasa.core.policies.ensemble - Made prediction using user intent.
2023-07-12 14:10:22 DEBUG rasa.core.policies.ensemble - Added `DefinePrevUserUtteredFeaturization(False)` event.
2023-07-12 14:10:22 DEBUG rasa.core.policies.ensemble - Predicted next action using RulePolicy.
2023-07-12 14:10:22 DEBUG rasa.core.processor - Predicted next action 'action_default_fallback' with confidence 0.30.

```

this is the error I am getting , I have also check if the entity is correctly extracted or not attaching screenshot from api/model/parse request

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/5/8/58ef2be7fa7ba7caaf6165e474f42db1246b5eb2.png)

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [July 17, 2023, 3:39pm UTC](https://forum.rasa.com/t/using-custom-entities-in-nlu-gives-default-fallback/58984/3 "2023-07-17T15:39:33Z")

</div>

I don’t have enough information to fully answer the question but you should consider changing the story to a series of short rules:

```yml
- rule: native_app_development
  intent: native_app_development
  action: action_native_app_development 
  action: utter_native_app_development_selection

- rule: android_development
  intent: android_development
  action: utter_select_app_category_desc
  action: action_set_slot_native_development_type

- rule: provided_category
  intent: provided_category
  action: action_set_selected_app_category

```

---

<div class="post-metadata">

**Author:** ![karan-0603](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/karan-0603/32/23146_2.png) [@karan-0603](https://forum.rasa.com/u/karan-0603)\
**Post date:** [July 18, 2023, 4:41am UTC](https://forum.rasa.com/t/using-custom-entities-in-nlu-gives-default-fallback/58984/4 "2023-07-18T04:41:29Z")

</div>

Thanks @stephens , I found the Issue in the story i had to use slot was set when provided category to make the story work.

---

<div class="post-metadata">

**Author:** ![karan-0603](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/karan-0603/32/23146_2.png) [@karan-0603](https://forum.rasa.com/u/karan-0603)\
**Post date:** [July 18, 2023, 4:43am UTC](https://forum.rasa.com/t/using-custom-entities-in-nlu-gives-default-fallback/58984/5 "2023-07-18T04:43:20Z")

</div>

@stephens The issue with the series of short rules is I don’t want the provided category intent to trigger in middle of the conversation or at the start of the conversation

---

<div class="post-metadata">

**Author:** ![karan-0603](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/karan-0603/32/23146_2.png) [@karan-0603](https://forum.rasa.com/u/karan-0603)\
**Post date:** [July 18, 2023, 4:49am UTC](https://forum.rasa.com/t/using-custom-entities-in-nlu-gives-default-fallback/58984/6 "2023-07-18T04:49:12Z")

</div>

@stephens Can you show me a way how can I add JWT auth when using rasa web chat ? currently anyone can access my bot using the socketurl which is hosted on okteto.
