Same training data for multiple entities issue

Hello guys, I have developed chatbot using Rasa form and it is working fine. Chatbot asks questions to user and user gives answer. Now I have 2 queries and need solutions for how to tackle:

  1. Chatbot asks questions - First “What is your name?” and Second "What is your partner’s name? "… but since training data for both questions are same so when user enters answer for first question, rasa automatically assignes same answer for 2nd question. How can I solve this in Forms? Note: I am taking 2 separate entities and separate slots for both questions.

  2. Is there any way where I can directly fill the slot with whatever user has entered? Eg. Bot asks : where do you live? User replies: paofapod now my model is not trained for answer “paofapod”…so I directly want ti fill “location” slot with user answer.

Hi @Rushi_B, I think you might be able to solve both problems with the slot mapping (see our documentation).
(1) I assume you currently have something entities like name and partner_name and slots with the same name. I would change this. I would just use one entity name and then have two different slots person_name and partner_name. You can then use the following slot mapping to fill the slots:

{
        "person_name": self.from_entity(entity="name"),
        "partner_name": self.from_entity(entity="name"),
}

(2) If you want to fill a slot with whatever the user entered, you can use the from_text slot mapping, e.g.

{
        "location": [
            self.from_entity(entity="location"),
            self.from_text(),
        ]
}

You may want to restrict the slot mapping to a specific intent. Please take a look at the documentation for more details. Does that work?

Thank u for quick reply. Solution for 2nd question is working at most extent…but for first it is not…I did as u suggested kept single entity “name” and created two slots - “user_name” and “partners_name” but it is still not able to distinguish between two slots.

Can you please share the slot mapping and run your bot in debug mode and share the log output here? Thanks.

Yess sure…

Here is my slot mapping —

    def slot_mappings(self) -> Dict[Text,Union[Dict, List[Dict]]]:
    return {
        "user_name": self.from_entity(entity="name"),
        "partner_name": self.from_entity(entity="name"),
        "partner_address": self.from_entity(entity="partner_address"),
        "date_of_engagement": self.from_entity(entity="date_of_engagement")
    }

debug mode log-----

partner_debug_log.txt (21.0 KB)

nlu.md file data for name -

intent:name_entry

intent:partner_name_entry

Ah, yes. That is due to the fact how we updated the slot mapping handling recently. I think this PR should fix the issue. Feel free to check it out.

i’m almost facing the same issue , i have two different intent one is identity_verification and another one is balance . now i have ‘yes’ as training data in both the intents . Now my model is getting confused whenever it’s receiving response ‘yes’ in between these two intents.