mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-07 05:40:20 +03:00
Format.
This commit is contained in:
parent
8c88543c0c
commit
e64a9ea499
|
@ -485,11 +485,15 @@ class EntityLinker(TrainablePipe):
|
||||||
# This makes it tricky to receive the last sentence by indexing doc.sents - hence we use an offset
|
# This makes it tricky to receive the last sentence by indexing doc.sents - hence we use an offset
|
||||||
# to determine sent_indices[1].
|
# to determine sent_indices[1].
|
||||||
sent_indices = (
|
sent_indices = (
|
||||||
sentences.index(sents[0]),
|
(
|
||||||
sentences.index(sents[0]) + len(sents) - 1,
|
sentences.index(sents[0]),
|
||||||
) if len(sents) > 1 else (
|
sentences.index(sents[0]) + len(sents) - 1,
|
||||||
sentences.index(ent.sent),
|
)
|
||||||
sentences.index(ent.sent),
|
if len(sents) > 1
|
||||||
|
else (
|
||||||
|
sentences.index(ent.sent),
|
||||||
|
sentences.index(ent.sent),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
assert all([si >= 0 for si in sent_indices])
|
assert all([si >= 0 for si in sent_indices])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user