mirror of https://github.com/explosion/spaCy.git
add line that got removed from EntityLinker
This commit is contained in:
parent
12dc8ab208
commit
2f6062a8a4
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue