rasa/core/featurizers.py
def _create_states(self,
                       tracker: DialogueStateTracker,
                       domain: Domain,
                       is_binary_training: bool = False
                       ) -> List[Dict[Text, float]]:
        """Create states: a list of dictionaries.
            If use_intent_probabilities is False (default behaviour),
            pick the most probable intent out of all provided ones and
            set its probability to 1.0, while all the others to 0.0."""
        states = tracker.past_states(domain)

        # during training we encounter only 1 or 0
        if not self.use_intent_probabilities and not is_binary_training:
            bin_states = []
            for state in states:
                # copy state dict to preserve internal order of keys
                bin_state = dict(state)
                best_intent = None
                best_intent_prob = -1.0
                for state_name, prob in state:
                    if state_name.startswith('intent_'):
                        if prob > best_intent_prob:
                            # finding the maximum confidence intent
                            if best_intent is not None:
                                # delete previous best intent
                                del bin_state[best_intent]
                            best_intent = state_name
                            best_intent_prob = prob
                        else:
                            # delete other intents
                            del bin_state[state_name]

                if best_intent is not None:
                    # set the confidence of best intent to 1.0
                    bin_state[best_intent] = 1.0

                bin_states.append(bin_state)
            return bin_states
        else:
            return [dict(state) for state in states]
Create states: a list of dictionaries.
            If use_intent_probabilities is False (default behaviour),
            pick the most probable intent out of all provided ones and
            set its probability to 1.0, while all the others to 0.0.
Create states: a list of dictionaries.
If use_intent_probabilities is False (default behaviour),
pick the most probable intent out of all provided ones and
set its probability to 1.0, while all the others to 0.0.
Create states : a list of dictionaries . If use_intent_probabilities is False ( default behaviour ) pick the most probable intent out of all provided ones and set its probability to 1 . 0 while all the others to 0 . 0 .
def _create_states(self,
                       tracker: DialogueStateTracker,
                       domain: Domain,
                       is_binary_training: bool = False
                       ) -> List[Dict[Text, float]]:
        states = tracker.past_states(domain)
        if not self.use_intent_probabilities and not is_binary_training:
            bin_states = []
            for state in states:
                bin_state = dict(state)
                best_intent = None
                best_intent_prob = -1.0
                for state_name, prob in state:
                    if state_name.startswith('intent_'):
                        if prob > best_intent_prob:
                            if best_intent is not None:
                                del bin_state[best_intent]
                            best_intent = state_name
                            best_intent_prob = prob
                        else:
                            del bin_state[state_name]
                if best_intent is not None:
                    bin_state[best_intent] = 1.0
                bin_states.append(bin_state)
            return bin_states
        else:
            return [dict(state) for state in states]
def _create_states ( self , tracker : DialogueStateTracker , domain : Domain , is_binary_training : bool = False ) -> List [ Dict [ Text , float ] ] : states = tracker . past_states ( domain ) if not self . use_intent_probabilities and not is_binary_training : bin_states = [ ] for state in states : bin_state = dict ( state ) best_intent = None best_intent_prob = - 1.0 for state_name , prob in state : if state_name . startswith ( 'intent_' ) : if prob > best_intent_prob : if best_intent is not None : del bin_state [ best_intent ] best_intent = state_name best_intent_prob = prob else : del bin_state [ state_name ] if best_intent is not None : bin_state [ best_intent ] = 1.0 bin_states . append ( bin_state ) return bin_states else : return [ dict ( state ) for state in states ]
Create states: a list of dictionaries.
Create states : a list of dictionaries .
"""Create states: a list of dictionaries.
            If use_intent_probabilities is False (default behaviour),
            pick the most probable intent out of all provided ones and
            set its probability to 1.0, while all the others to 0.0.""" # during training we encounter only 1 or 0 # copy state dict to preserve internal order of keys # finding the maximum confidence intent # delete previous best intent # delete other intents # set the confidence of best intent to 1.0
self
tracker
DialogueStateTracker
domain
Domain
is_binary_training
bool