Hi!
Situation: There are two groups (independent and dependent variables). Each of these groups have either categorical or numerical typed variables. Depending on the matrix of variables, there’s an output.
nlu.yml:
What analysis do I use if [indep]{“entity”:‘depOrIndep_var’, “group”:“indepgroup”} variables are [num]{“entity”: “numOrCat_var1”, “group”: “indepgroup”} and [cat]{“entity”: “numOrCat_var2”, “group”: “indepgroup”} but [dependent]{“entity”: “depOrIndep_var”, “group”: “depgroup”} variables are [numerical]{“entity”: “numOrCat_var3”, “group”: “depgroup”}?
domain.yml:
entities:
- depOrIndep_var groups:
- indepgroup
- depgroup
- numOrCat_var: groups:
- indepgroup
- depgroup slots: indepgroup: type: text mappings:
- type: from_entity entity: depOrIndep_var group: indepgroup depgroup: type: text mappings:
- type: from_entity entity: depOrIndep_var group: depgroup depOrIndep: type: text mappings:
- type: from_entity entity: depOrIndep_var conditions:
- active_loop: info_test_form numOrCat1: type: text mappings:
- type: from_entity entity: numOrCat_var1 group: indepgroup conditions:
- active_loop: info_test_form numOrCat2: type: text mappings:
- type: from_entity entity: numOrCat_var2 group: indepgroup conditions:
- active_loop: info_test_form numOrCat3: type: text mappings:
- type: from_entity entity: numOrCat_var3 group: depgroup conditions:
- active_loop: info_test_form
action.py
class ActionInfoTestForm(Action):
def name(self) → Text: return “action_info_test_form”
def run(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any]) → List[Dict[Text, Any]]:
dependency_group1 = tracker.get_latest_entity_values(entity_type="depOrIndep_var", group="firstgroup_var") numOrCat1_group1 = tracker.get_latest_entity_values(entity_type="numOrCat_var1", group="firstgroup_var") numOrCat2_group1 = tracker.get_latest_entity_values(entity_type="numOrCat_var2", group="firstgroup_var") dependency_group2 = tracker.get_latest_entity_values(entity_type="depOrIndep_var", group="secondgroup_var") numOrCat3_group2 = tracker.get_latest_entity_values(entity_type="numOrCat_var3", group="secondgroup_var") timeToEvent = tracker. get_latest_entity_values(entity_type="timeToEvent_var", group="secondgroup_var") if dependency_group1 in indep_alt and numOrCat1_group1 in num_alt and numOrCat2_group1 in cat_alt and dependency_group2 in dep_alt and numOrCat3_group2 in num_alt: dispatcher.utter_message(template= 'utter_indepnumcat_depnum') if dependency_group1 in indep_alt and numOrCat1_group1 in num_alt and numOrCat2_group1 in cat_alt and dependency_group2 in dep_alt and numOrCat3_group2 in cat_alt: dispatcher.utter_message(template= 'utter_indepnumcat_depcat') if dependency_group1 in indep_alt and numOrCat1_group1 in num_alt and numOrCat2_group1 in cat_alt and dependency_group2 in dep_alt and timeToEvent in time2event_alt: dispatcher.utter_message(template= 'utter_indepnumcat_deptimetoevent')
Is this a correct way to do it? Since dependent or not is a group itself, must I specifically label the entity as groups?