# Same training data for multiple entities issue

**URL:** <https://forum.rasa.com/t/same-training-data-for-multiple-entities-issue/31285>\
**Category:** Rasa Open Source\
**Created:** [July 13, 2020, 5:13am UTC](https://forum.rasa.com/t/same-training-data-for-multiple-entities-issue/31285 "2020-07-13T05:13:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rushi\_B](https://avatars.discourse-cdn.com/v4/letter/r/4bbf92/32.png) [@Rushi\_B](https://forum.rasa.com/u/Rushi_B)\
**Post date:** [July 13, 2020, 5:13am UTC](https://forum.rasa.com/t/same-training-data-for-multiple-entities-issue/31285/1 "2020-07-13T05:13:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tanja](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tanja/32/4696_2.png) [@Tanja](https://forum.rasa.com/u/Tanja)\
**Post date:** [July 13, 2020, 6:50am UTC](https://forum.rasa.com/t/same-training-data-for-multiple-entities-issue/31285/2 "2020-07-13T06:50:42Z")

</div>

Hi @Rushi_B, I think you might be able to solve both problems with the slot mapping (see [our documentation](https://rasa.com/docs/rasa/core/forms/#custom-slot-mappings)).  
(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:

```auto
{
        "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.

```auto
{
        "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?

---

<div class="post-metadata">

**Author:** ![Rushi\_B](https://avatars.discourse-cdn.com/v4/letter/r/4bbf92/32.png) [@Rushi\_B](https://forum.rasa.com/u/Rushi_B)\
**Post date:** [July 13, 2020, 10:12am UTC](https://forum.rasa.com/t/same-training-data-for-multiple-entities-issue/31285/3 "2020-07-13T10:12:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tanja](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tanja/32/4696_2.png) [@Tanja](https://forum.rasa.com/u/Tanja)\
**Post date:** [July 13, 2020, 10:29am UTC](https://forum.rasa.com/t/same-training-data-for-multiple-entities-issue/31285/4 "2020-07-13T10:29:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Rushi\_B](https://avatars.discourse-cdn.com/v4/letter/r/4bbf92/32.png) [@Rushi\_B](https://forum.rasa.com/u/Rushi_B)\
**Post date:** [July 13, 2020, 11:34am UTC](https://forum.rasa.com/t/same-training-data-for-multiple-entities-issue/31285/5 "2020-07-13T11:34:46Z")

</div>

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](https://forum.rasa.com/uploads/short-url/mQ6EUR99Wgl248Mj58NsncH68kW.txt) (21.0 KB)

nlu.md file data for name -

## intent:name\_entry

- My name is Adam
- My name is Martha
- My name is Eva
- My name is Jonas
- My name is John
- My self Jacom
- Amy
- My name is Ava
- My name is Chris
- My name is Daniel

## intent:partner\_name\_entry

- Partner name is Jona
- Partner name is Eva
- Partner name is Adam
- Partner name is Tom
- Partner name is Jerry
- Partner name is Martha
- Partner self Terry
- Raymond
- John
- Sheldon
- Jacob
- Partner name is Samuel

---

<div class="post-metadata">

**Author:** ![Tanja](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tanja/32/4696_2.png) [@Tanja](https://forum.rasa.com/u/Tanja)\
**Post date:** [July 13, 2020, 12:38pm UTC](https://forum.rasa.com/t/same-training-data-for-multiple-entities-issue/31285/6 "2020-07-13T12:38:27Z")

</div>

Ah, yes. That is due to the fact how we updated the slot mapping handling recently. I think this [PR](https://github.com/RasaHQ/rasa-sdk/pull/237) should fix the issue. Feel free to check it out.

---

<div class="post-metadata">

**Author:** ![AditiMondal](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@AditiMondal](https://forum.rasa.com/u/AditiMondal)\
**Post date:** [October 4, 2023, 4:14am UTC](https://forum.rasa.com/t/same-training-data-for-multiple-entities-issue/31285/7 "2023-10-04T04:14:33Z")

</div>

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.
