From 780d43aac7ecceb177d27eb76424c516a869d014 Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Fri, 6 Dec 2019 19:18:14 +0100 Subject: [PATCH] fix bug in EL predict (#4779) --- spacy/pipeline/pipes.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/pipeline/pipes.pyx b/spacy/pipeline/pipes.pyx index 97b27d7ce..82f9b665f 100644 --- a/spacy/pipeline/pipes.pyx +++ b/spacy/pipeline/pipes.pyx @@ -1302,7 +1302,7 @@ class EntityLinker(Pipe): if len(doc) > 0: # Looping through each sentence and each entity # This may go wrong if there are entities across sentences - because they might not get a KB ID - for sent in doc.ents: + for sent in doc.sents: sent_doc = sent.as_doc() # currently, the context is the same for each entity in a sentence (should be refined) sentence_encoding = self.model([sent_doc])[0]