From 73c830c0e780eabc0457a9dbac0e46cb9e48ae71 Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Fri, 10 Mar 2023 14:35:27 +0100 Subject: [PATCH] Fix mypy error. --- spacy/pipeline/entity_linker.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spacy/pipeline/entity_linker.py b/spacy/pipeline/entity_linker.py index 2dba78f9f..443f0fe34 100644 --- a/spacy/pipeline/entity_linker.py +++ b/spacy/pipeline/entity_linker.py @@ -474,6 +474,7 @@ class EntityLinker(TrainablePipe): # Looping through each entity in batch (TODO: rewrite) for j, ent in enumerate(ent_batch): + assert hasattr(ent, "sents") sents = list(ent.sents) # Note: the last sentence associated with an sentence-crossing entity isn't complete. E. g. if you # have "Mahler's Symphony No. 8 was beautiful", the entity being "No. 8", ent.sents would be: