コード例 #1
0
def top_intent(intent_dict) :
    max_intent = Intent.NONE_INTENT
    max_value = 0.0
    for intent, intentScore in intent_dict.items():
        if intentScore.score > max_value:
            max_intent, max_value = intent, intentScore.score
    return TopIntent(max_intent, max_value)
コード例 #2
0
ファイル: luis_helper.py プロジェクト: kwahome/delivery-bot
def top_intent(intents: Dict[Intent, dict]) -> TopIntent:
    max_intent = Intent.NONE_INTENT
    max_value = 0.0

    for intent, value in intents:
        intent_score = IntentScore(value)
        if intent_score.score > max_value:
            max_intent, max_value = intent, intent_score.score

    return TopIntent(max_intent, max_value)
コード例 #3
0
ファイル: bot.py プロジェクト: Fortune-Adekogbe/Diary-bot
def top_intent(intents: Dict[Intent, dict]) -> TopIntent:
    """
    This function determines the top intention of a user.
    """
    max_intent = Intent.NONE_INTENT
    max_value = 0.0

    for intent, value in intents:
        intent_score = IntentScore(value)
        if intent_score.score > max_value:
            max_intent, max_value = intent, intent_score.score

    return TopIntent(max_intent, max_value)