mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Fix combined scores if multiple components report it
This commit is contained in:
parent
0b52b6904c
commit
26e28ed413
|
@ -1237,7 +1237,9 @@ def combine_score_weights(
|
||||||
weight = 0.0
|
weight = 0.0
|
||||||
else:
|
else:
|
||||||
weight = round(value / total / len(all_weights), 2)
|
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
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user