mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-05 21:00:19 +03:00
Format. Update assert in ent.sents handling.
This commit is contained in:
parent
9b6f47f1ac
commit
fc0f954d9b
|
@ -476,8 +476,11 @@ class EntityLinker(TrainablePipe):
|
|||
for j, ent in enumerate(ent_batch):
|
||||
assert hasattr(ent, "sents")
|
||||
sents = list(ent.sents)
|
||||
sent_indices = (sentences.index(sents[0]), sentences.index(sents[-1]))
|
||||
assert all([si >= 0 for si in sent_indices])
|
||||
sent_indices = (
|
||||
sentences.index(sents[0]),
|
||||
sentences.index(sents[-1]),
|
||||
)
|
||||
assert sent_indices[-1] >= sent_indices[0] >= 0
|
||||
|
||||
if self.incl_context:
|
||||
# get n_neighbour sentences, clipped to the length of the document
|
||||
|
|
Loading…
Reference in New Issue
Block a user