All problems
Exact Match Rate
Problem
Return the fraction of predictions that exactly equal their references, comparing element by element. Return 0.0 for an empty prediction list. Assumes the two lists have the same length.
Test cases
case 1
in: [["a","b","c"],["a","x","c"]]
expected: 0.6666666666666666
case 2
in: [["yes"],["no"]]
expected: 0
case 3
in: [[],[]]
expected: 0
case 4
in: [["1","2"],["1","2"]]
expected: 1
Starter codePython
def exact_match_rate(preds, refs):
# Your code here
pass4 test cases · run your code against them in the editor