# How to manage a users 'name only' response

**URL:** <https://forum.rasa.com/t/how-to-manage-a-users-name-only-response/42047>\
**Category:** Rasa Open Source\
**Created:** [April 3, 2021, 11:26am UTC](https://forum.rasa.com/t/how-to-manage-a-users-name-only-response/42047 "2021-04-03T11:26:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tubazilla](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tubazilla/32/14231_2.png) [@tubazilla](https://forum.rasa.com/u/tubazilla)\
**Post date:** [April 3, 2021, 11:26am UTC](https://forum.rasa.com/t/how-to-manage-a-users-name-only-response/42047/1 "2021-04-03T11:26:06Z")

</div>

I am struggling to get consistent results in my testing when I provide a ‘name only’ response; for example: user: Hello bot: Hi there I am the BakerStreetBot - what mystery may I investigate for you? user: I appear to have mislaid my spectacles bot: oh dear! Please tell me your name and I can see what I can do to help user: Sherlock Holmes bot: Hi there I am the BaerStreetBot - what mystery may I investigate for you? \*\* this is wrong - it should have had a different response \*\*

* * *

If I trained the bot in interactive or manually added ‘Sherlock Holmes’ as a response in my NLU.yml file it works fine - as does providing a more complete as as the user (for example: My name is Sherlock Holmes) - but whenever I introduce a new name I get the same behaviour as that exhibited above. Is this purely down to a lack of training examples?

…I’m using SPACY…

Thanks for any tips or advice.

loving being part of this community 🙂

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [April 3, 2021, 11:58am UTC](https://forum.rasa.com/t/how-to-manage-a-users-name-only-response/42047/2 "2021-04-03T11:58:27Z")

</div>

I don’t know if that’s the best solution, but consider using a lookup table: [person\_name.yml](https://forum.rasa.com/uploads/short-url/zyp7EPGot34O89iEnZQkWoAR7VW.yml) (2.6 MB)

* * *

You can also make it into a [form](https://rasa.com/docs/rasa/forms/) that will take the whole text as a response and save it in a slot.

In your `domain.yml` file:

```auto
forms:
  form_name:
    mystery:
    - intent_name: None
      not_intent: stop
      type: from_text
    username:
    - intent_name: None
      not_intent: stop
      type: from_text

```

---

<div class="post-metadata">

**Author:** ![tubazilla](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tubazilla/32/14231_2.png) [@tubazilla](https://forum.rasa.com/u/tubazilla)\
**Post date:** [April 3, 2021, 12:21pm UTC](https://forum.rasa.com/t/how-to-manage-a-users-name-only-response/42047/3 "2021-04-03T12:21:33Z")

</div>

Thanks @ChrisRahme I’ll give this a go!

---

<div class="post-metadata">

**Author:** ![tubazilla](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tubazilla/32/14231_2.png) [@tubazilla](https://forum.rasa.com/u/tubazilla)\
**Post date:** [April 3, 2021, 12:29pm UTC](https://forum.rasa.com/t/how-to-manage-a-users-name-only-response/42047/4 "2021-04-03T12:29:20Z")

</div>

Thanks again @ChrisRahme - I’m a newby here :-). Just searching for how I would use such a yaml file… is there a link to where I will find this documented?

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [April 3, 2021, 12:35pm UTC](https://forum.rasa.com/t/how-to-manage-a-users-name-only-response/42047/5 "2021-04-03T12:35:21Z")

</div>

No worries!

You just place the file anywhere in the `data` folder (I create a `lookups` folder inside of it).

Just replace `person_name` with the name of the entity (and slot), and that’s it. This is like if you gave the bot NLU examples with all the following names.

```auto
version: "2.0"
nlu:
  - lookup: person_name
    examples: |
      - ...

```

You can read more about lookup tables [here](https://rasa.com/docs/rasa/training-data-format#lookup-tables) and [here](https://rasa.com/docs/rasa/nlu-training-data#lookup-tables).

---

<div class="post-metadata">

**Author:** ![themrcesi](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/themrcesi/32/14099_2.png) [@themrcesi](https://forum.rasa.com/u/themrcesi)\
**Post date:** [April 13, 2021, 9:54am UTC](https://forum.rasa.com/t/how-to-manage-a-users-name-only-response/42047/6 "2021-04-13T09:54:23Z")

</div>

Hi there!

@ChrisRahme your solution also works for me, thanks a lot.

However, is there a way to use a lookup table from (for example) a txt file where each line represents a possible value of the entity?

Thanks again!

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [April 13, 2021, 3:39pm UTC](https://forum.rasa.com/t/how-to-manage-a-users-name-only-response/42047/7 "2021-04-13T15:39:24Z")

</div>

I don’t think so… But if you want, I quickly wrote a script that does just transforms a text file into the appropriate YAML file. Just place it in the same folder as the text file.

[txt\_to\_yml.py](https://forum.rasa.com/uploads/short-url/1JPTPWlCAbfVovozHhyt6yiJGQy.py) (546 Bytes)

---

<div class="post-metadata">

**Author:** ![themrcesi](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/themrcesi/32/14099_2.png) [@themrcesi](https://forum.rasa.com/u/themrcesi)\
**Post date:** [April 14, 2021, 10:13am UTC](https://forum.rasa.com/t/how-to-manage-a-users-name-only-response/42047/8 "2021-04-14T10:13:30Z")

</div>

Ohh, thanks a lot! I already did it yesterday haha.

I guess it should be nice to have an option to “attach” a txt file for a lookup.

Thanks a lot 🙂
