Issues trying to implement EntitySynonymMapper with lookup tables - Rasa Open Source - Rasa Community Forum

👋 Introducing the Rasa Playground

Issues trying to implement EntitySynonymMapper with lookup tables

post by isic5 on Jan 9, 2020

I am currently trying to implement EntitySynonymMapper with Lookup tables. What I have setup so far in my training data is the lookup table for the entity category and entity_synonyms as mentioned here Entity Synonyms Documentation.

I also added EntitySynonymMapper to my Config file.

The issue is, that my Entities still only get properly recognized if I use the exact spelling from the lookup tables. If I mention alternative spellings that are mentioned in my entity_synonyms it does not get picked up.

Anything I am missing?

Example: I have in my category lookup table a category named Infrastructure and I created a synonym in my training data like so:

synonym:Infrastructure

training data for the intent Inform looks like so:

My config: config.yml (513 Bytes)

Now If I type the exact phrase Can you get me the category Infrastructure, It works correctly, but if I type: Can you get me the category Infra, it does not detect Infra as the entity Infrastructure.

Any help is appreciated, if there is a better method of going about this entirely, I'm also open.

End goal is to simply ask the user to provide a category and then using that category for a database query.

Thanks!

post by Gehova on Jan 9, 2020

You need to add the synonyms to the lookup table. That’s because the pipeline in rasa, it first detects that a gram is an entity and then the synonym mapper changes it.

post by isic5 on Jan 9, 2020

Thanks for your suggestions, but this simply leads to the category being filled with the synonym value, but it doesn't get changed. So now if I type Get me the category “Infra” it detects it correctly but just fills the slot with “Infra” instead of replacing it with “Infrastructure”. Do I need to somehow include this in my stories or something?

For your information I am using Rasa X to talk to the bot and adapt things, so maybe this is also causing the issue?

post by Gehova on Jan 9, 2020

Your pipeline is incorrect. The CRFEntityExtractor must be placed before the EntitySynonymMapper. Check the documentation about pipelines:

post by isic5 on Jan 10, 2020

Thanks so much… I spent way too much time trying to figure out what I was doing wrong. This fixed it.