All problems
METEOR Weighted F-mean
Problem
Return the METEOR weighted F-mean of precision and recall:
Fmean = (1 + beta ** 2) * precision * recall / (recall + beta ** 2 * precision)
beta controls the recall weight, with METEOR traditionally using beta = 3. Return 0.0 when the denominator is 0.
Hint
When beta is 0 the formula reduces to precision.
Test cases
case 1
in: [0.5,0.5,3]
expected: 0.5
case 2
in: [1,0.5,3]
expected: 0.5263157894736842
case 3
in: [0,0.5,1]
expected: 0
case 4
in: [0.5,0.5,0]
expected: 0.5
case 5
in: [1,1,2]
expected: 1
Starter codePython
def meteor_weighted_fmean(precision, recall, beta):
# Your code here
pass5 test cases · run your code against them in the editor