add line that got removed from EntityLinker

This commit is contained in:
svlandeg 2020-06-20 23:14:45 +02:00
parent 12dc8ab208
commit 2f6062a8a4
1 changed files with 53 additions and 52 deletions

View File

@ -1302,6 +1302,7 @@ class EntityLinker(Pipe):
# Looping through each sentence and each entity
# This may go wrong if there are entities across sentences - which shouldn't happen normally.
for sent_index, sent in enumerate(sentences):
if sent.ents:
# get n_neightbour sentences, clipped to the length of the document
start_sentence = max(0, sent_index - self.n_sents)
end_sentence = min(len(sentences) -1, sent_index + self.n_sents)