libraries/botbuilder-ai/botbuilder/ai/luis/luis_recognizer.py
def top_intent(
        results: RecognizerResult, default_intent: str = "None", min_score: float = 0.0
    ) -> str:
        """Returns the name of the top scoring intent from a set of LUIS results.
        
        :param results: Result set to be searched.
        :type results: RecognizerResult
        :param default_intent: Intent name to return should a top intent be found, defaults to "None"
        :param default_intent: str, optional
        :param min_score: Minimum score needed for an intent to be considered as a top intent. If all intents in the set are below this threshold then the `defaultIntent` will be returned, defaults to 0.0
        :param min_score: float, optional
        :raises TypeError:
        :return: The top scoring intent name.
        :rtype: str
        """

        if results is None:
            raise TypeError("LuisRecognizer.top_intent(): results cannot be None.")

        top_intent: str = None
        top_score: float = -1.0
        if results.intents:
            for intent_name, intent_score in results.intents.items():
                score = intent_score.score
                if score > top_score and score >= min_score:
                    top_intent = intent_name
                    top_score = score

        return top_intent or default_intent
def top_intent(
        results: RecognizerResult, default_intent: str = "None", min_score: float = 0.0
    ) -> str:
        """Returns the name of the top scoring intent from a set of LUIS results.
        
        :param results: Result set to be searched.
        :type results: RecognizerResult
        :param default_intent: Intent name to return should a top intent be found, defaults to "None"
        :param default_intent: str, optional
        :param min_score: Minimum score needed for an intent to be considered as a top intent. If all intents in the set are below this threshold then the `defaultIntent` will be returned, defaults to 0.0
        :param min_score: float, optional
        :raises TypeError:
        :return: The top scoring intent name.
        :rtype: str
        """

        if results is None:
            raise TypeError("LuisRecognizer.top_intent(): results cannot be None.")

        top_intent: str = None
        top_score: float = -1.0
        if results.intents:
            for intent_name, intent_score in results.intents.items():
                score = intent_score.score
                if score > top_score and score >= min_score:
                    top_intent = intent_name
                    top_score = score

        return top_intent or default_intent
Returns the name of the top scoring intent from a set of LUIS results.
        
        :param results: Result set to be searched.
        :type results: RecognizerResult
        :param default_intent: Intent name to return should a top intent be found, defaults to "None"
        :param default_intent: str, optional
        :param min_score: Minimum score needed for an intent to be considered as a top intent. If all intents in the set are below this threshold then the `defaultIntent` will be returned, defaults to 0.0
        :param min_score: float, optional
        :raises TypeError:
        :return: The top scoring intent name.
        :rtype: str