From 251a5b43ac04d5028504a751ab21490c629b61d8 Mon Sep 17 00:00:00 2001 From: Paul O'Leary McCann Date: Sat, 3 Jul 2021 18:41:46 +0900 Subject: [PATCH] Minor fix in crossing spans code I think this was technically incorrect but harmless. The reason the code here is different than the reference in coref-hoi is that the indices there are such that they get +1 at the end of processing, while the code here handles indices directly. --- spacy/ml/models/coref_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/ml/models/coref_util.py b/spacy/ml/models/coref_util.py index e045ad31b..b0a632bd8 100644 --- a/spacy/ml/models/coref_util.py +++ b/spacy/ml/models/coref_util.py @@ -162,7 +162,7 @@ def select_non_crossing_spans( start, end = starts[idx], ends[idx] cross = False - for ti in range(start, end + 1): + for ti in range(start, end): max_end = start_to_max_end.get(ti, -1) if ti > start and max_end > end: cross = True