From 26e28ed4134734dbc86fedb97339eec47282025a Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Thu, 24 Sep 2020 17:11:13 +0200 Subject: [PATCH] Fix combined scores if multiple components report it --- spacy/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/util.py b/spacy/util.py index ad3298651..378ec2823 100644 --- a/spacy/util.py +++ b/spacy/util.py @@ -1237,7 +1237,9 @@ def combine_score_weights( weight = 0.0 else: weight = round(value / total / len(all_weights), 2) - result[key] = result.get(key, 0.0) + weight + prev_weight = result.get(key, 0.0) + prev_weight = 0.0 if prev_weight is None else prev_weight + result[key] = prev_weight + weight return result