# Unable to use lookup functionality

**URL:** <https://forum.rasa.com/t/unable-to-use-lookup-functionality/42424>\
**Category:** Rasa Open Source\
**Created:** [April 14, 2021, 12:01pm UTC](https://forum.rasa.com/t/unable-to-use-lookup-functionality/42424 "2021-04-14T12:01:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishalk](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vishalk](https://forum.rasa.com/u/vishalk)\
**Post date:** [April 14, 2021, 12:01pm UTC](https://forum.rasa.com/t/unable-to-use-lookup-functionality/42424/1 "2021-04-14T12:01:39Z")

</div>

Hi ,

We are using names.txt file as a lookup table to extract name entity. Rasa version used is 2.5.0 This file is placed into data directory.

The entities are not getting extracted at all.

the entity name is “myname”. Attached are the files.

Please comment .

-thanks Vishal[nlu.yml](https://forum.rasa.com/uploads/short-url/smskQCZZeNnDhVpAcpYVCp3qRm8.yml) (4.1 KB) [myname.yml](https://forum.rasa.com/uploads/short-url/9Nm5xdM1yzO5Mziy1uQiGnTEb9g.yml) (770.9 KB) [config.yml](https://forum.rasa.com/uploads/short-url/h8tWTd2bXcQPN1cJKt6XDyrbf4i.yml) (1.4 KB)

---

<div class="post-metadata">

**Author:** ![m.vielkind](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m.vielkind/32/12693_2.png) [@m.vielkind](https://forum.rasa.com/u/m.vielkind)\
**Post date:** [April 14, 2021, 12:13pm UTC](https://forum.rasa.com/t/unable-to-use-lookup-functionality/42424/2 "2021-04-14T12:13:38Z")

</div>

Hi @vishalk there are a couple things you can do to extract names. First, you could try using the `SpacyEntityExtractor` to extract names. Since spaCy is trained on a large corpus of names you can leverage those by adding `SpacyEntityExtractor` to your pipeline.

The other option would be to try adding `RegexEntityExtractor` to your pipeline and making sure you set `use_lookup_tables: True`. Adding this to your pipeline will generate RegEx expressions for all the samples in your lookup table and extract entities based on those RegEx.

For more background on either of these options you can read this blog post:

> **[Proper Name Detection](https://blog.rasa.com/named-name-recognition/)**
>
> Detecting names in a user message is a common challenge when designing a virtual assistant. It's a task many Rasa users face, which is why you can find many questions on the topic in the Rasa forum. It’s also an issue that is more complicated than...

---

<div class="post-metadata">

**Author:** ![vishalk](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vishalk](https://forum.rasa.com/u/vishalk)\
**Post date:** [April 14, 2021, 1:38pm UTC](https://forum.rasa.com/t/unable-to-use-lookup-functionality/42424/3 "2021-04-14T13:38:56Z")

</div>

Thanks Matthew, I tried the second approach, its working.

Sometimes fails for the names not in lookup.

Any tips for increasing the accuracy of a model ?

- Vishal

---

<div class="post-metadata">

**Author:** ![m.vielkind](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/m.vielkind/32/12693_2.png) [@m.vielkind](https://forum.rasa.com/u/m.vielkind)\
**Post date:** [April 14, 2021, 3:01pm UTC](https://forum.rasa.com/t/unable-to-use-lookup-functionality/42424/4 "2021-04-14T15:01:39Z")

</div>

Happy to hear it’s working!

The `RegexEntityExtractor` is going to construct its name list from what you provide in your lookup table. If there are example names not in your lookup then it’s going to be difficult to extract. What you could do for this situation is if you’re not able to extract a name from the user’s message you can ask a follow-up for the user to ask their name. Then you can add those names to your lookup table.

---

<div class="post-metadata">

**Author:** ![vishalk](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@vishalk](https://forum.rasa.com/u/vishalk)\
**Post date:** [April 15, 2021, 5:11am UTC](https://forum.rasa.com/t/unable-to-use-lookup-functionality/42424/5 "2021-04-15T05:11:20Z")

</div>

Hi Matthew,

In the first approach that u suggested, the spacy entity extractor takes full name instead of first name. for e.g. If the sentence contains Chris Hemsworth, then it extracts it correctly instead if it has Chris only, it fails. Is this the expected behavior ? as person might be entering first name only.

-thanks Vishal
