@NicolasD Hello, I not tried personally this scenario but give it a try or please ref this link: NLU Training Data and even this Domain for role and group only.
stories:
- story: Order black tea
steps:
- intent: orderdrink
entities:
- black_tea_qty: true
role: order_black_tea
- slot_was_set:
- black_tea_qty: true
role: order_black_tea
- action: black_tea_order_form
- active_loop: black_tea_order_form
- active_loop: null
- action: utter_black_tea_slots_values
- intent: affirm
- action: action_order_drinks
- action: utter_order_confirmed
- action: clear_slots
PS: Even your training data is not in proper format, please sort that out
Note: We most likely would need to add the roles and groups to their respective entities in the domain file. The entities keyword in the domain file would then become a dictionary instead of a list.
Or just use entities rather than slot?
Some pointers (Thanks to Tanja) Ref: Introducing entity roles and groups
-
UserUttered.as_sub_state
: Add the roles/groups to the list of entities. Concatenate the role/group names with the entity names to make sure they are unquie. - Update the yml stories format to include roles/groups next to entities
- Update the domain file to be able to add entities with roles and groups
-
ignore_entities
for intents should not be modified. We treat roles/groups as part of the entities. E.g. if an entity with a role was detected but it should be ignored, also ignore the role. If an entity with a role was detected and it should be considered for the intent, consider the entity and the role. To achieve that we need to split the concatenated names again. -
Domain
needs to store entities with roles and groups - Add a method
entity_states
to theDomain
that returns all entity names + the concatenated names of roles/groups and entities. -
SingleStateFeaturizer
should use the newentity_states
method of the domain inprepare_from_domain
- Modify an existing example to include entity roles/groups (needs to be clarified)
- Verify that e2e tests contains entity roles and groups