All problems
Unanswerable Detection
Problem
Return True when the example should be treated as unanswerable: no span scores exist or the maximum score is strictly below threshold.
A score exactly equal to the threshold is answerable.
Hint
The comparison is strict less-than, so a threshold hit counts as answerable.
Test cases
case 1
in: [[0.1,0.2],0.5]
expected: true
case 2
in: [[0.6],0.5]
expected: false
case 3
in: [[],0.5]
expected: true
case 4
in: [[0.5],0.5]
expected: false
Starter codePython
def unanswerable_detection(span_scores, threshold):
# Your code here
pass4 test cases · run your code against them in the editor