# How to deal with categorical entity where one category can be defined and other is "the rest"

**URL:** https://forum.rasa.com/t/how-to-deal-with-categorical-entity-where-one-category-can-be-defined-and-other-is-the-rest/54417
**Category:** Rasa Open Source
**Created:** [July 21, 2022, 11:58am UTC](https://forum.rasa.com/t/how-to-deal-with-categorical-entity-where-one-category-can-be-defined-and-other-is-the-rest/54417 "2022-07-21T11:58:52Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Bert](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@Bert](https://forum.rasa.com/u/Bert)
#### Post date: [July 21, 2022, 11:58am UTC](https://forum.rasa.com/t/how-to-deal-with-categorical-entity-where-one-category-can-be-defined-and-other-is-the-rest/54417/1 "2022-07-21T11:58:52Z")

</div>

I’ll give a small example of my problem. (It’s not the actual use-case)

So I want to fill a slot in a form with the entity in\_stock which can have 2 values: available or not\_available.

In my nlu file I added my entities that all map to available. Under synonyms I added those entities under available as well:

```auto
- synonym: available
  examples: |
    - pear
    - apple
    - banana

```

Now, when I ask the user what products would you like to check, this works well when the user wants to check available products. When the user enters pear, the slot in\_stock gets set to available and my actions work as planned. However, when a user enters a product that’s not available, RASA doesn’t recognize that product as the entity in\_stock with value not\_available because i didn’t define it.

How can I still set the in\_stock slot to not\_available when the user enters out of stock items or items i didn’t think of. Rasa doesn’t recognize those as an entity. I thought of making synonyms for not\_available but there are so many options.

---

<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 22, 2022, 4:45pm UTC](https://forum.rasa.com/t/how-to-deal-with-categorical-entity-where-one-category-can-be-defined-and-other-is-the-rest/54417/2 "2022-07-22T16:45:56Z")

</div>

Use a custom action
