Skip to content
Snippets Groups Projects
Commit 053c878b authored by Franck Dary's avatar Franck Dary
Browse files

Avoid division by 0 in eval script

parent cd0e0326
No related branches found
No related tags found
No related merge requests found
......@@ -470,7 +470,9 @@ def evaluate(gold_ud, system_ud, extraColumns) :
denom1 += (predictedValues[i]-predMean)**2
denom2 += (goldValues[i]-goldMean)**2
pearson = numerator/((denom1**0.5)*(denom2**0.5))
pearson = 0.0
if denom1 > 0.0 and denom2 > 0.0 :
pearson = numerator/((denom1**0.5)*(denom2**0.5))
R2 = pearson**2
return [Score(gold, system, correct, aligned, isNumeric=isNumericOnly, R2=R2), errors]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment