Hi,
I am new in Kore. The documentation says we can populate the entities using Traits Engine. But only the intent detection and dialog transition were explained using traits. Can someone please help me understand the entity extraction using traits?
When an user enters an utterance, then I want the bot to capture all the entities possible from that utterance and only trigger the entities which were not extracted for a better user experience.
Please let me know if there is a different way to do this.
Thanks,
Sushma.
1 Like
Traits do NOT populate entities automatically.
When a trait is detected then its name is pushed into an array in the context object. It is left up to the bot developer to use script to check for their presence and to decide what to do.
When a flow reaches an entity node then the platform will check all the current utterances - that means the original utterance plus any others that have happened subsequently in this flow, to see if there is a valid value BEFORE prompting. The prompt will only happen if there is no valid value (or the prompt is forced to happen). If the entity node finds a valid value in those utterances then the processing moves straight onto its connections.
Therefore there is typically no need to capture all entities up front because by default the flow will only prompt for missing data. For the platform, what constitutes missing data is no value in the context.entities.<entityname>
value. Note that value could just as easily be added via script!
Now one useful technique is to have a series of entities with the User Input instance property set to hidden. In this scenario the entity will check for a value once but will not prompt if nothing is found. These entities can be the exact same component as one used later when the input property is set to mandatory.
Where this tactic is helpful is in scenarios where the best extraction order is different that the prompt order. Generally it is better to extract closed and specific values (dates, numbers) before open values (names and strings), or where knowledge of one entity helps influence another. But that extraction order might not be the most natural way to hold a conversation.
And finally to circle back to traits, one reason traits do not automatically populate entities is that there is no sentence context captured via traits, it is “just a feeling”. What that means in practice is that entities track which words from the utterances are used during the extraction so that those same words are not reused by another entity. Traits do not generate that specific word data and so there is no way to prevent the same words being used twice.