From 48b90c8e1cf3942862ebc14e61842148060fa784 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 19 Mar 2021 09:43:52 +0100 Subject: [PATCH] Update deprecated doc.is_sentenced in Corpus --- spacy/training/corpus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/training/corpus.py b/spacy/training/corpus.py index ae7b89f15..079b872d6 100644 --- a/spacy/training/corpus.py +++ b/spacy/training/corpus.py @@ -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]