Parse entity from list

Hi!

I’m really new with Rasa, so probably it’s already answered, but I tried to look for information everywhere but can’t find about this.

What I’m trying to do, is give a list to Rasa for possible values for an entity. For example, let’s say counties: I give rasa a manual list of countries, and if I say “I want to go to Spain”, it extracts Spain. If i say “I want to go to Spin”, it should extract “Spain” again.

I tried with lookup tables ( not sure if I’m doing wrong with it) but it keeps extracting the entity even if it’s not in the lookup table.

Is the correct way to do this lookup tables?

If there’s no way integrated, can I use the API to parse that entity? For example, when I recieve “Franc”, try to parse with custom action or form validation to find the closest match, in this case, “France”?

And the second question, is there a way to do this with a dynamic list?

Thank you so much in advance! :slight_smile:

Lookup tables are correct but you still need to write a custom action to validate the slot.

I just try to do the API parse and Let you know.

Hello again!

@stephens

Lookup tables are correct but you still need to write a custom action to validate the slot.

That’s what i’m using, but how I said, doesn’t parse from the list, just gets the entity, even if it’s not from the list. But I’ll keep trying to see if I’m doing something wrong, thank you!

@Meadowsrittenhouse

I just try to do the API parse and Let you know.

Thank you! I would like to use all this process with Rasa, because I think will be more accurated if it uses some kind of parser or NLU.

In a side note, for now I fixed it from pure Python. How I said, since this way doesn’t use NLU, I think it will give a lot of errors, but just for you to know: using difflib.get_close_matches works for both sides, parsing, and since it’s from code, I can use a dynamic list of items from wich to parse.