From e64a9ea499b49251491d610e20a1c04c3a1d5ecd Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Fri, 10 Mar 2023 14:21:31 +0100 Subject: [PATCH] Format. --- spacy/pipeline/entity_linker.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/spacy/pipeline/entity_linker.py b/spacy/pipeline/entity_linker.py index a9a3fe1d0..2dba78f9f 100644 --- a/spacy/pipeline/entity_linker.py +++ b/spacy/pipeline/entity_linker.py @@ -485,11 +485,15 @@ class EntityLinker(TrainablePipe): # This makes it tricky to receive the last sentence by indexing doc.sents - hence we use an offset # to determine sent_indices[1]. sent_indices = ( - sentences.index(sents[0]), - sentences.index(sents[0]) + len(sents) - 1, - ) if len(sents) > 1 else ( - sentences.index(ent.sent), - sentences.index(ent.sent), + ( + sentences.index(sents[0]), + sentences.index(sents[0]) + len(sents) - 1, + ) + if len(sents) > 1 + else ( + sentences.index(ent.sent), + sentences.index(ent.sent), + ) ) assert all([si >= 0 for si in sent_indices])