def _predict_label(self, predict_out: Optional[Dict[(Text, tf.Tensor)]]) -> Tuple[(Dict[(Text, Any)], List[Dict[(Text, Any)]])]:
    'Predicts the intent of the provided message.'
    label: Dict[(Text, Any)] = {'name': None, 'confidence': 0.0}
    label_ranking = []
    if (predict_out is None):
        return (label, label_ranking)
    message_sim = predict_out['i_scores']
    message_sim = message_sim.flatten()
    if (message_sim.size == 0):
        return (label, label_ranking)
    ranking_length = self.component_config[RANKING_LENGTH]
    renormalize = (self.component_config[RENORMALIZE_CONFIDENCES] and (self.component_config[MODEL_CONFIDENCE] == SOFTMAX))
    (ranked_label_indices, message_sim) = train_utils.rank_and_mask(message_sim, ranking_length=ranking_length, renormalize=renormalize)
    casted_message_sim: List[float] = message_sim.tolist()
    top_label_idx = ranked_label_indices[0]
    label = {'name': self.index_label_id_mapping[top_label_idx], 'confidence': casted_message_sim[top_label_idx]}
    ranking = [(idx, casted_message_sim[idx]) for idx in ranked_label_indices]
    label_ranking = [{'name': self.index_label_id_mapping[label_idx], 'confidence': score} for (label_idx, score) in ranking]
    return (label, label_ranking)
Predicts the intent of the provided message.
def _predict_label(self, predict_out: Optional[Dict[(Text, tf.Tensor)]]) -> Tuple[(Dict[(Text, Any)], List[Dict[(Text, Any)]])]:
    
    label: Dict[(Text, Any)] = {'name': None, 'confidence': 0.0}
    label_ranking = []
    if (predict_out is None):
        return (label, label_ranking)
    message_sim = predict_out['i_scores']
    message_sim = message_sim.flatten()
    if (message_sim.size == 0):
        return (label, label_ranking)
    ranking_length = self.component_config[RANKING_LENGTH]
    renormalize = (self.component_config[RENORMALIZE_CONFIDENCES] and (self.component_config[MODEL_CONFIDENCE] == SOFTMAX))
    (ranked_label_indices, message_sim) = train_utils.rank_and_mask(message_sim, ranking_length=ranking_length, renormalize=renormalize)
    casted_message_sim: List[float] = message_sim.tolist()
    top_label_idx = ranked_label_indices[0]
    label = {'name': self.index_label_id_mapping[top_label_idx], 'confidence': casted_message_sim[top_label_idx]}
    ranking = [(idx, casted_message_sim[idx]) for idx in ranked_label_indices]
    label_ranking = [{'name': self.index_label_id_mapping[label_idx], 'confidence': score} for (label_idx, score) in ranking]
    return (label, label_ranking)