From d470fa03c15dadaf7bbc2fc71497aed9d5c9db8e Mon Sep 17 00:00:00 2001 From: Paul O'Leary McCann Date: Wed, 13 Apr 2022 20:19:21 +0900 Subject: [PATCH] Adjust end indices It's not clear if this is technically correct or not but it won't run without it for me. --- spacy/pipeline/coref.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spacy/pipeline/coref.py b/spacy/pipeline/coref.py index fc04d1a3e..6c408d117 100644 --- a/spacy/pipeline/coref.py +++ b/spacy/pipeline/coref.py @@ -567,7 +567,9 @@ class SpanPredictor(TrainablePipe): if key.startswith(self.output_prefix): for mention in sg: starts.append(mention.start) - ends.append(mention.end) + # TODO check: Is the -1 here correct? + # In Akos's env it works without, but in Paul's it doesn't. + ends.append(mention.end - 1) starts = self.model.ops.xp.asarray(starts) ends = self.model.ops.xp.asarray(ends)