Using entity roles to distinguish semantics roles in entities of the same type
Rasa offers entity roles in which to distinguish the different roles of the same entity type. Let's take a look at an example of booking a flight ticket between New York and Chicago. If the system does not distinguish the departure and destination roles of the city entity, the bot will not able to understand whether the ticket is from New York to Chicago or from Chicago to New York. With the entity role, the entity has additional information that represents its semantic role (such as the departure or the destination), which will solve this problem for the bot.
To use entity roles, we need to annotate our training data with the role information along with the entity type. Some sample training data appears as follows:
A flight ticket from [New York]{"entity": "city", "role": "departure"} to [Chicago]{"entity":"city", "role":"...