Search code examples
dialogflow-es

Dialogflow: match multiple entity entries on a single query


I have a entity type of say "Example", its type is "map"
Say I have two properties under it: entityA and entityB
entityA and entityB have the same synonym "Textdata"

I have an intent which has a training phrase of @Example

Now when I query "Textdata" only entityA gets matched
I want dialogflow to return all the entities matched which in this case would include entityB as well since entityB also have the textdata synonym

Example EntityType


Solution

  • This isn't possible, Dialogflow only returns one entity per located match. So getting back both entityA and entityB while providing only a single word in your phrase isn't possible.

    It could detect both entities if your bot supports phrases where a user mentions both entities in a single phrase. (For example: "Give me all documents named TextData(EntityA) of type TextData(EntityB)). Dialogflow can do this because it also pays attention to the position of words in a sentence when recognizing intents. This does require well defined examples and extra attention to model training.