I have two intents with similar data and both are used for slot filling in the same form. How do I block one intent for

These are my two intents:

- intent: reply_yearlybill

  examples: |

    - [1000](yearlybill)

    - [100](yearlybill)

    - [e1e](yearlybill)

    - My yearly bill is [1000](yearlybill)

    - It's around [100](yearlybill)

    - About [10000](yearlybill)

    - Its around [100](yearlybill)

    - It is around [100](yearlybill)

    - Around [10103](yearlybill)

    - About [1000](yearlybill)

- intent: intent_areasize

  examples: |

    - [10](areasize)

    - Its around [100](areasize)

    - About [1000](areasize)

    - Its around [1000](areasize)

They are both being used in the same form to slot fill. What is a good approach to avoid collision? Is there a way to ignore an intent until a slot has been set?

1 Like

help please

@Juste can you please help with this? Is there a way I can disable an intent until a slot is filled?

Hey @BrookieHub . I think the best option to approach this is to include slot mappings into your form so that the slot yearlybill is filled in with the details extracted from the reply_yearlybill intent and the slot areasize is filled in with the details extracted from the intent_areasize intent (I assume that you have the slots named the same as your entities).

To achieve that, try configuring your form the following way (I assume you are running on Rasa Open Source version 2.x):

  yearlybill_form:
    required_slots:
        yearlybill:
        - type: from_entity
          entity: yearlybill
          intent: reply_yearlybill
          not_intent: intent_areasize

What is happening here is that by adding the slot mapping above, you define that the slot yearlybill should be set using the information extracted from an entity yearlybill and only from the intent reply_yearlybill. You can add another proxy of specifying the intent that should NOT be used ti fill in this slot - in this case it could be intent_areasize.

You should include a similar mapping for the slot areasize.

If you are new to slot mappings you can find more info here in our documentation.

2 Likes

Thank you so much @Juste for the reply!

I have configured my form with the slots as you mentioned, however it still doesn’t recognize the correct intent.

I also tried to remove the “reply_yearlybill” from the form and explicitly mentioning it inside “ignored_intent” property, like such:

forms:

  invoice_form:

    ignored_intents:

    - reply_yearlybill

    required_slots:

      SolutionType:

      - type: from_entity

        entity: SolutionType

      pk_city:

      - type: from_entity

        entity: pk_city

      units:

      - type: from_entity

        entity: units

      areasize:

      - type: from_entity

        entity: areasize

        intent: intent_areasize

        not_intent: reply_yearlybill

However, when I have invoice_form active, it still chooses reply_yearlybill, even though I added it inside the ignored_intents.

So maybe the problem lies within the intent recognition. Is there a way to temporary disable reply_yearlybill while I am inside the forms?

Thanks again :smiley: !

Oh, I see it know. Yes, your model will very likely struggle to do the intent classification correctly because the examples you have for each intent are very similar.

My questions is - do you really need separate intents? You could created unified intent “inform” and have an entity “number” which could be used to fill in the slots.

2 Likes

I would preferably want it to be two seperate intents, but if there is no way to lock an intent, then yes your suggested approach seems to do the trick.

Thanks a lot for the help! I’ll get started with the implementation :smiley: !

Hi @BrookieHub , I’m facing similar issue… Can you please share how did you implement your solution?