Skip to content
DeepForgeby svx
All problems
EasyNLPnlp-161

Intent Top-1

Problem

Return the intent with the highest score, keeping the earliest intent in the list on ties.

Return an empty string when the intent list is empty.

Hint

Only strictly greater scores replace the current best.

Test cases

case 1
in: [["greet","order"],[0.2,0.8]]
expected: "order"
case 2
in: [["a","b"],[0.5,0.5]]
expected: "a"
case 3
in: [[],[]]
expected: ""
case 4
in: [["x","y","z"],[0.1,0.9,0.9]]
expected: "y"
Starter codePython
def intent_top1(intents, scores):
    # Your code here
    pass

4 test cases · run your code against them in the editor