Rasa entities extraction which appears to be similar for slot filling via forms. How to extract name of partner and name of customer in a form?

Actually I am creating a form which has 7 slots in it namely : customer name , partner name , license type , max users , max developers and project name. While creating the intent with the entities mentioned in the brackets I have created it like below :

So now as the customer name and partner name is appears like similar entity as both are names the model struggles to differentiate and accept the entity. Though I define the intents separately it does not work. It takes in the customer name but while recognizing the partner name it does not take that input name as partner name entity and asks for the same slot rpeatedly. Similarly max_users intent is recognized but the model again struggles to recognize max_devs next to max_users entity as both are numbers. How to deal with this problem ? Is entity roles concept applicable here ? If yes please give an ellaborated example with all files included : nlu , domain , actions , stories , rules. If not please find me another solution with elaborated explanation.

This is how I have defined my slots :point_down:

Let me attach the interactive shell snapshots :point_down:

It repeatedly asks for my partner name but does not recognize the name though it asks me to mark the entity.

Lastly if the form is without the slots partner name and max developers it works perfectly fine. But when I include these two entities in the form I am not at able to find any solution anywhere as resources regarding this issue is limited.

@ nik202

Since partner and customer are both names, you should have a single name entity and map the name entity to the slots:

slots:
  customer:
    type: text
    influence_conversation: false
    mapping:
    - type: from_entity
      entity: name

  partner:
    type: text
    influence_conversation: false
    mapping:
    - type: from_entity
      entity: name

Though I define the intents separately it does not work

Slot filling in forms does not use intents. Also, in our example bots, we typically create a single inform intent.

1 Like

Thanks Sir , It worked. But the same way it did not work for max_users and max _devs slots? It can recognize both max_users and max_devs but not does not allot the value to the respective slot for max_devs.

Let me show the domain.yml file: point_down:

Interactive shell:

It recognizes the intent and entity properly but does not allot the value in the slot for max_devs.

@stephens Kindly guide me

Can you share the repo.

I have got the solution. Thank you :grinning:

For your use case, I think it is better to use Forms and filling the slots.

I am facing a similar problem here… Here is my nlu.yml flíle

version: “3.1” nlu:

  • intent: greet examples: |
    • hello
    • hi
    • hey
    • good morning
    • good evening
  • intent: affirm examples: |
    • yes
    • yeah
    • sure
    • okay
    • I’m okay
    • alright
    • yes of course
    • great
    • yes, please
    • of-course
    • let’s begin
    • let’s start
    • start the questions
    • yes, go ahead
  • intent: deny examples: |
    • no
    • nope
    • not now
    • maybe later
    • not really
  • intent: goodbye examples: |
    • bye

And in domain file, i have the forms and slot

forms: health_form: required_slots: - health_permission_granted - stress_question_1 - stress_question_2 - stress_question_3 - stress_question_4 slots: health_permission_granted: type: bool initial_value: false influence_conversation: true mappings: - type: from_intent intent: affirm value: true conditions: - active_loop: health_form requested_slot: health_permission_granted - type: from_intent intent: deny value: false conditions: - active_loop: health_form requested_slot: health_permission_granted stress_question_1: type: bool initial_value: false influence_conversation: false mappings: - type: from_text intent: affirm value: true conditions: - active_loop: health_form requested_slot: stress_question_1 - type: from_text intent: deny value: false conditions: - active_loop: health_form requested_slot: stress_question_1

Now let me describe my problem… Actually the bot has to ask a permission question to the user, asking his content whether to proceed with asking some health questions. So when the user affirms, it proceeds asking the list of questions and when denies, it say goodbye and exits the form.

Now after getting affirmation from the user to proceed with the health related questions (stress is used in here) , when the bot starts asking the health related questions and when the user replies with “yes” or “no” answer, it has to actually fill the slot (stress_question_1)that we defined for the health related question but for me in my case, the health_permission_granted slot being updated unexpectedly during the validation of stress-related questions.

so at the end , whenever am gonna answer “no” to a health related questions, it is giving the utter_bye response which is meant to given when the health_permission_granted slot is filled “true”. But i want to just proceed with the next question and not give thanks response.

I see the issue to be because of the same intents like affirm and deny been used in different slots. Can someone help me with this ?

@Ponharshita-P @stephens Can you please share how to solve it? I got the same problem here I have 2 input about measurement that have the same characteristic eg. 10mm 2mm

Are you using a form? Can you give some example utterances that cause issues?