def _get_confusion_description(self, slot, da_type): slot_confusion_des = self.config["default"] if slot in self.config.keys(): slot_confusion_des = self.config[slot] refine_key = da_type + "_confusion_matrix" if refine_key in slot_confusion_des.keys(): # this da_type is refined for this slot refine = slot_confusion_des[refine_key] slot_confusion_des = override_dicts(refine, slot_confusion_des["default_confusion_matrix"]) else: slot_confusion_des = slot_confusion_des["default_confusion_matrix"] return slot_confusion_des
def _get_confused_acts(self, da_type): act_confusion = self.config['act_confusion'] confusion_des = act_confusion['default']['confusion_matrix'] if da_type in act_confusion.keys(): confusion_des = override_dicts(act_confusion[da_type]['confusion_matrix'], confusion_des) #confusion_des = confusion_des['confusion_matrix'] confusable_values = confusion_des['confusable_acts'] if da_type not in confusable_values: confusable_values.append(da_type) acts, probs = self._get_confused_values(confusion_des, da_type, confusable_values) return acts, probs
def _get_confusion_description(self, slot, da_type): '''Get confusion description for the given slot.''' slot_confusion_des = self.config['default'] if slot in self.config.keys(): slot_confusion_des = self.config[slot] refine_key = da_type + '_confusion_matrix' if refine_key in slot_confusion_des.keys():#this da_type is refined for this slot refine = slot_confusion_des[refine_key] slot_confusion_des = override_dicts(refine, slot_confusion_des['default_confusion_matrix']) else: slot_confusion_des = slot_confusion_des['default_confusion_matrix'] return slot_confusion_des
def _get_confused_acts(self, da_type): '''Get confused actions and coresponding probability for an action type.''' self.system_logger.debug('Get confused acts:%s'%da_type) act_confusion = self.config['act_confusion'] confusion_des = act_confusion['default']['confusion_matrix'] if da_type in act_confusion.keys(): confusion_des = override_dicts(act_confusion[da_type]['confusion_matrix'], confusion_des) #confusion_des = confusion_des['confusion_matrix'] confusable_values = confusion_des['confusable_acts'] if da_type not in confusable_values: confusable_values.append(da_type) acts, probs = self._get_confused_values(confusion_des, da_type, confusable_values) return acts, probs