def semantic_noise(self, act):
        """
        Simulates semantic noise. It receives an act and introduces errors
        given the Error Model's probabilities.

        :param act: the act to be confused
        :return: the confused act
        """
        if act.intent == 'inform':
            for item in act.params:
                if item.slot in self.ontology.ontology['informable']:
                    if random.random() < self.slot_confuse_prob and item.slot:
                        item.slot = \
                            random.choice(
                                list(
                                    self.ontology
                                        .ontology['informable'].keys()))
                        item.value = \
                            random.choice(
                                self.ontology
                                    .ontology['informable'][item.slot])

                    if random.random() < self.op_confuse_prob:
                        item.op = random.choice(Operator)

                    if random.random() < self.value_confuse_prob:
                        item.value = \
                            random.choice(
                                self.ontology
                                    .ontology['informable'][item.slot])
                else:
                    # We're not raising errors here because the simulated user
                    # may be following a statistical dialogue_policy
                    print('Warning! ErrorModel: Slot {0} not in informable '
                          'slots!'.format(item.slot))

        elif act.intent == 'request':
            for item in act.params:
                if random.random() < self.slot_confuse_prob:
                    if item.slot in self.ontology.ontology['requestable']:
                        item.slot = \
                            random.choice(
                                self.ontology.ontology['requestable'])
                        item.value = ''
                    else:
                        # We're not raising an error here because the simulated
                        # user may be following a statistical dialogue_policy
                        print('Warning! ErrorModel: Slot {0} not in '
                              'requestable slots!'.format(item.slot))

        return act

        Simulates semantic noise. It receives an act and introduces errors
        given the Error Model's probabilities.

        :param act: the act to be confused
        :return: the confused act
        
plato/agent/component/user_simulator/agenda_based_user_simulator/error_model.py