rasa/core/policies/fallback.py
def predict_action_probabilities(self,
                                     tracker: DialogueStateTracker,
                                     domain: Domain) -> List[float]:
        """Predicts a fallback action.

        The fallback action is predicted if the NLU confidence is low
        or no other policy has a high-confidence prediction.
        """

        nlu_data = tracker.latest_message.parse_data

        # if NLU interpreter does not provide confidence score,
        # it is set to 1.0 here in order
        # to not override standard behaviour
        nlu_confidence = nlu_data.get("intent", {}).get("confidence", 1.0)

        if tracker.latest_action_name == self.fallback_action_name:
            result = [0.0] * domain.num_actions
            idx = domain.index_for_action(ACTION_LISTEN_NAME)
            result[idx] = 1.0

        elif self.should_nlu_fallback(nlu_confidence,
                                      tracker.latest_action_name):
            logger.debug("NLU confidence {} is lower "
                         "than NLU threshold {}. "
                         "".format(nlu_confidence, self.nlu_threshold))
            result = self.fallback_scores(domain)

        else:
            # NLU confidence threshold is met, so
            # predict fallback action with confidence `core_threshold`
            # if this is the highest confidence in the ensemble,
            # the fallback action will be executed.
            result = self.fallback_scores(domain, self.core_threshold)

        return result
Predicts a fallback action.

        The fallback action is predicted if the NLU confidence is low
        or no other policy has a high-confidence prediction.
        
Predicts a fallback action.
The fallback action is predicted if the NLU confidence is low
or no other policy has a high-confidence prediction.
Predicts a fallback action . The fallback action is predicted if the NLU confidence is low or no other policy has a high - confidence prediction .
def predict_action_probabilities(self,
                                     tracker: DialogueStateTracker,
                                     domain: Domain) -> List[float]:
        nlu_data = tracker.latest_message.parse_data
        nlu_confidence = nlu_data.get("intent", {}).get("confidence", 1.0)
        if tracker.latest_action_name == self.fallback_action_name:
            result = [0.0] * domain.num_actions
            idx = domain.index_for_action(ACTION_LISTEN_NAME)
            result[idx] = 1.0
        elif self.should_nlu_fallback(nlu_confidence,
                                      tracker.latest_action_name):
            logger.debug("NLU confidence {} is lower "
                         "than NLU threshold {}. "
                         "".format(nlu_confidence, self.nlu_threshold))
            result = self.fallback_scores(domain)
        else:
            result = self.fallback_scores(domain, self.core_threshold)
        return result
def predict_action_probabilities ( self , tracker : DialogueStateTracker , domain : Domain ) -> List [ float ] : nlu_data = tracker . latest_message . parse_data nlu_confidence = nlu_data . get ( "intent" , { } ) . get ( "confidence" , 1.0 ) if tracker . latest_action_name == self . fallback_action_name : result = [ 0.0 ] * domain . num_actions idx = domain . index_for_action ( ACTION_LISTEN_NAME ) result [ idx ] = 1.0 elif self . should_nlu_fallback ( nlu_confidence , tracker . latest_action_name ) : logger . debug ( "NLU confidence {} is lower " "than NLU threshold {}. " "" . format ( nlu_confidence , self . nlu_threshold ) ) result = self . fallback_scores ( domain ) else : result = self . fallback_scores ( domain , self . core_threshold ) return result
Predicts a fallback action.
Predicts a fallback action .
"""Predicts a fallback action.

        The fallback action is predicted if the NLU confidence is low
        or no other policy has a high-confidence prediction.
        """ # if NLU interpreter does not provide confidence score, # it is set to 1.0 here in order # to not override standard behaviour # NLU confidence threshold is met, so # predict fallback action with confidence `core_threshold` # if this is the highest confidence in the ensemble, # the fallback action will be executed.
self
tracker
DialogueStateTracker
domain
Domain