I need to compare the entities from the user message with the entities from the intent associated. I know how to extract the entities from the user message in a custom action, but I don’t know how to extract automatically all the entities (defined in the nlu file) from the intent.
@mar Can I ask what is the significance of extracting the entities? Firstly, the entities you have defined is the nlu training example under specific intent, and all the stories. I guess that what user will mention in the bot/user conversation? Secondly, what do you mean by extract automatically all the entities? I guess, the bot/user conversation will be set based on question and respective answer for some extent? Please clarify us this approach.
@mar I guess Chris suggesting this or something else :
you can extract the value using this:
ent = tracker.latest_message['entities'][0]['value']
“ent” is an array with a dict inside, so the “[0]” is for get in the dict and you can obtain anything inside using the name of the key, in this case “value”.
I meant to have in a custom action the entities I defined for an intent in the nlu file. The idea is to compare those entities with the ones given in the user message.