Skip to content
DeepForgeby svx
All problems
EasyNLPnlp-393

Token Level Recall Generation

Problem

Generation recall is the multiset overlap divided by the number of reference tokens; return 0.0 when empty.

Given predicted and reference tokens, return the recall.

Hint

Divide the overlap by the reference size.

Test cases

case 1
in: [["a","b","c"],["a","b"]]
expected: 1
case 2
in: [["x"],["y"]]
expected: 0
case 3
in: [["a"],[]]
expected: 0
Starter codePython
def token_level_recall_generation(predicted, reference):
    # Your code here
    pass

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