Compute exact-match accuracy of model outputs: the fraction of positions where the predicted string equals the expected string after removing leading and trailing whitespace. Pairs are formed with zip, so extra items in the longer list are ignored.
Implement solve(predictions,targets).
Returns. Return a float in [0,1].
Example 1
Input:
solve(['cat', 'dog', 'yes'], ['cat', 'cat', 'yes'])
Output:
0.666667
Example 2
Input:
solve([' cat ', 'Dog'], ['cat', 'dog'])
Output:
0.5
No results yet
Run your code to check it against the examples, or submit to run every test.