diff --git a/scripts/conll18_ud_eval.py b/scripts/conll18_ud_eval.py index 371cbc1f2a2e0b8947edc645909e4c2aa134c275..5b76aaa5e40426ae2a68b3b4dad003afe8729f33 100755 --- a/scripts/conll18_ud_eval.py +++ b/scripts/conll18_ud_eval.py @@ -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]