Unable to use lookup functionality

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 Vishalnlu.yml (4.1 KB) myname.yml (770.9 KB) config.yml (1.4 KB)

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:

1 Like

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

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.

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