fix bug in EL predict (#4779)

This commit is contained in:
Sofie Van Landeghem 2019-12-06 19:18:14 +01:00 committed by Ines Montani
parent bf611ebca7
commit 780d43aac7

View File

@ -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]