Description of changes:
This code: denominator = sum(model_verdicts) + 1e-10 will lead to inaccurate context precision score when sum(model_verdicts) > 0 and numerator > 0. For example: 1 / (1 + 1e-10) = 0.9999999999
Fixed this by returning 0 if sum(model_verdicts) is 0.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Description of changes: This code:
denominator = sum(model_verdicts) + 1e-10
will lead to inaccurate context precision score whensum(model_verdicts) > 0
andnumerator > 0
. For example:1 / (1 + 1e-10) = 0.9999999999
Fixed this by returning0
ifsum(model_verdicts)
is0
.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.