# Error when working with categorical slot

**URL:** <https://forum.rasa.com/t/error-when-working-with-categorical-slot/49884>\
**Category:** Rasa Open Source\
**Created:** [December 9, 2021, 12:59pm UTC](https://forum.rasa.com/t/error-when-working-with-categorical-slot/49884 "2021-12-09T12:59:26Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![LafA](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/lafa/32/18874_2.png) [@LafA](https://forum.rasa.com/u/LafA)\
**Post date:** [December 9, 2021, 12:59pm UTC](https://forum.rasa.com/t/error-when-working-with-categorical-slot/49884/1 "2021-12-09T12:59:26Z")

</div>

There is a problem with categorical slots that worries me a lot.

```auto
Dialog example:
User: I want a chocolate bar?
Bot: You can buy a chocolate bar in our store using the link: ...
User: I want a white chocolate (the entity "white" is extracted and placed in the slot)
Bot: You can buy a white chocolate bar in our store at the link: ...
User: I want a chocolate bar?
Bot: You can buy a white chocolate bar in our store at the link: ...

```

First problem: the slot is not updated to the value “None” if the intent goes without specifying the entity.

The second problem: For example, the User sealed himself up and asked “I want a wite chocolate”, then the extracted entity will be “wite” despite the fact that there is no such slot category, how to cope with this? I know that you can use synonyms, but it is impossible to take into account all the typos.

```auto
nlu:
- intent: i_want_a_chocolate_bar
  examples: |
    - I want a chocolate bar
    - want a chocolate
    - I want a [white](chocolate_type) chocolate
    - want a [white](chocolate_type) chocolate
    - I want a [milk](chocolate_type) chocolate
    - want a [milk](chocolate_type) chocolate
    - I want a [dark](chocolate_type) chocolate
    - want a [dark](chocolate_type) chocolate

```

```auto
stories:
- story: i_want_a_chocolate_bar
  steps:
  - intent: i_want_a_chocolate_bar
  - slot_was_set:
    - chocolate_type: null
  - action: utter_i_want_a_chocolate_bar

- story: i_want_a_white_chocolate
  steps:
  - intent: i_want_a_chocolate_bar
  - slot_was_set:
    - chocolate_type: white
  - action: utter_i_want_a_white_chocolate

- story: i_want_a_milk_chocolate
  steps:
  - intent: i_want_a_chocolate_bar
  - slot_was_set:
    - chocolate_type: milk
  - action: utter_i_want_a_milk_chocolate

- story: i_want_a_dark_chocolate
  steps:
  - intent: i_want_a_chocolate_bar
  - slot_was_set:
    - chocolate_type: dark
  - action: utter_i_want_a_dark_chocolate

```

domain:

```auto
intents:
  - i_want_a_chocolate_bar
entities:
  - chocolate_type
slots:
  chocolate_type:
    type: categorical
    values:
      - white
      - milk
      - dark
responses:
  utter_i_want_a_chocolate_bar:
  - text: "You can buy a chocolate bar in our store using the link: ..."
  utter_i_want_a_white_chocolate:
  - text: "You can buy a white chocolate bar in our store at the link: ..."
  utter_i_want_a_milk_chocolate:
  - text: "You can buy milk chocolate in our store at the link: ..."
  utter_i_want_a_dark_chocolate:
  - text: "You can buy a dark chocolate bar in our store at the link: ..."
session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true

```

---

_[View the full topic](https://forum.rasa.com/t/error-when-working-with-categorical-slot/49884)._
