How to handle same intents


I am facing a problem while interacting with my bot. There are several sentences im my training-data with the same word order.
For example:

- how much fat is in the product
- how fat is it
- how much fat does it contain

- how much sugar is in the product
- how sweet is it
- how much sugar does it contain

As you might guess, my bot is giving me information about food. Unfortunately it often misinterprets the input and answers with the wrong ingredient.

Is there any way on how to avoid this behavior?

As your goal is to ask the same questions that only differ in what you’re asking about, I would recommend using the same intent and differing baed on entities. E.g.

##intent: ask_ingredient_quantity
- how much [fat](ingredient) is in the product
- how [fat](ingredient) is it
- how much [fat](ingredient) does it contain
- how much [sugar](ingredient) is in the product
- how [sweet](ingredient:sugar) is it
- how much [sugar](ingredient(does it contain

then you can differ in your stories based on the entity – either

* ask_ingredient_quantity{"ingredient": "fat"}
  - slot{"ingredient": "fat}"


* ask_ingredient_quantity{"ingredient": "sugar"}
  - slot{"ingredient": "sugar}"

For that one you want a categorical slot:

    slot_type: categorical
      - sugar
      - fat

Thank you for your answer, this is exactly what I wanted :slight_smile:

Regards Andreas

1 Like