Update data format to support composite entities #5465
Labels
area:rasa-oss 🎡
Anything related to the open source Rasa framework
type:enhancement ✨
Additions of new features or changes to existing ones, should be doable in a single PR
Description of Problem:
In a sentence like
I want to fly from Berlin to Amsterdam.
we not only want to annotateBerlin
andAmsterdam
as entitiescity
, but also want to assign specific roles to them.Berlin
should have the roleorigin
andAmsterdam
should have the roledestination
. With the current data format this is not doable.Overview of the Solution:
Markdown
We want to change the annotation format for entities:
I want to fly from [Berlin]{"entity": "city", "role": "origin"} to [LA]{"entity": "city", "role": "destination", "value": "Los Angeles"}.
orShow me [red]{"entity": "colour", "group": 0} [balloons]{"entity": "item", "group": 0} and [black]{"entity": "colour", "group": 1} [shoes]{"entity": "item", "group": 1}.
We will use
{}
to define entities that have roles/groups/synonyms. If you just have a simple entity without any role/group/synonym, the old format can still be used ([Berlin](city)
).We will deprecate the old syntax for synonyms, e.g.
[LA](city:Los Angeles)
. Instead users should use[LA]{"entity": "city", "value": "Los Angeles"}
. We should offer a script that converts the old format into the new format.JSON
We simply add new keywords to the entity definition in the JSON format:
Definition of Done:
The text was updated successfully, but these errors were encountered: