mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
Update deprecated doc.is_sentenced in Corpus
This commit is contained in:
parent
34e13c1161
commit
48b90c8e1c
|
@ -155,7 +155,7 @@ class Corpus:
|
|||
continue
|
||||
elif self.max_length == 0 or len(reference) < self.max_length:
|
||||
yield self._make_example(nlp, reference, False)
|
||||
elif reference.is_sentenced:
|
||||
elif reference.has_annotation("SENT_START"):
|
||||
for ref_sent in reference.sents:
|
||||
if len(ref_sent) == 0:
|
||||
continue
|
||||
|
@ -166,7 +166,7 @@ class Corpus:
|
|||
self, nlp: "Language", reference_docs: Iterable[Doc]
|
||||
) -> Iterator[Example]:
|
||||
for reference in reference_docs:
|
||||
if reference.is_sentenced:
|
||||
if reference.has_annotation("SENT_START"):
|
||||
ref_sents = [sent.as_doc() for sent in reference.sents]
|
||||
else:
|
||||
ref_sents = [reference]
|
||||
|
|
Loading…
Reference in New Issue
Block a user