Categories:
Recognition of utterances with several entities in Grammars
Specific guidelines in the scenario when the user’s utterance includes several entities to be recognized by Grammars through the use of roles
Use of roles for the recognition of utterances with several entities
If the user’s utterance contains several entities of the same type, it is required to add a role tag to the entity identifier, following the format:
[entity_name:rol_value]
The role tag is used by the system to identify that there are two entities of the same type but with different roles.
This process will not affect the final output of the Grammars.
That is, if the entity with the role is ent.audiovisual_sports_team:visitor, the system will only retrieve the tag ent.audiovisual_sports_team.
A practical example of Grammars that use this functionality is shown below:
- The utterance “I would like to see Madrid against Barsa” contains two entities of the same type:
[ent.audiovisual_sports_team] - For both entities to be detected correctly, it will be necessary to add the role when defining the name of the entities. For example, the roles of local and visitor could be assigned, resulting
[ent.audiovisual_sports_team:local]and[ent.audiovisual_sports_team:visitor]
Certain considerations must be considered:
- In order to recognize two entities of the same type in sequence, there is no need to create two entity graphs with the role tag but one, since the system is capable of discerning between the tagged entity and the untagged one.
- Entity values should be the same in both graphs.
- For better understanding purposes, we suggest using digits to name the entity graph having the role with the name of the role itself. For example:
ent.audiovisual_sports_team:1->ent.audiovisual_sports_team_1.grf
This can be also done using non-digit characters. That is, if the entityent.audiovisual_sports_teamhas the role “visitor” (ent.audiovisual_sports_team:visitor), the name of the graph should beent.audiovisual_sports_team_visitor.grf.
