class_docstr: Handles incoming messages with low NLU confidence.
class_docstr_tok: ["Handles","incoming","messages","with","low","NLU","confidence","."]
code: def _nlu_prediction_ambiguous(
      self, message: Message
  ) -> Tuple[bool, Optional[float]]:
      intents = message.data.get(INTENT_RANKING_KEY, [])
      if len(intents) >= 2:
          first_confidence = intents[0].get(
              PREDICTED_CONFIDENCE_KEY, 1.0
          )
          second_confidence = intents[1].get(
              PREDICTED_CONFIDENCE_KEY, 1.0
          )
          difference = first_confidence - second_confidence
          return (
              difference
              < self.component_config[AMBIGUITY_THRESHOLD_KEY],
              difference,
          )
      return False, None
  
imports: from __future__ import annotations
  import copy
  import logging
  from typing import Any, List, Text, Dict, Type, Union, Tuple, Optional
  from rasa.engine.graph import GraphComponent, ExecutionContext
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.shared.constants import DEFAULT_NLU_FALLBACK_INTENT_NAME
  from rasa.core.constants import DEFAULT_NLU_FALLBACK_THRESHOLD, DEFAULT_NLU_FALLBACK_AMBIGUITY_THRESHOLD
  from rasa.nlu.classifiers.classifier import IntentClassifier
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.constants import INTENT, INTENT_NAME_KEY, INTENT_RANKING_KEY, PREDICTED_CONFIDENCE_KEY
label_desc: Use image node_id 8 for calling the FallbackClassifier obj's underlying member method code with example usage: obj._nlu_prediction_ambiguous(message) and returns: False,  None, unknown,  difference