diff --git a/spacy/pipeline/entity_linker.py b/spacy/pipeline/entity_linker.py index 4165dab83..45713108a 100644 --- a/spacy/pipeline/entity_linker.py +++ b/spacy/pipeline/entity_linker.py @@ -387,7 +387,7 @@ class EntityLinker(Pipe): docs (Iterable[Doc]): The documents to modify. kb_ids (List[str]): The IDs to set, produced by EntityLinker.predict. - DOCS: https://spacy.io/api/entitylinker#predict + DOCS: https://spacy.io/api/entitylinker#set_annotations """ count_ents = len([ent for doc in docs for ent in doc.ents]) if count_ents != len(kb_ids): diff --git a/spacy/pipeline/morphologizer.pyx b/spacy/pipeline/morphologizer.pyx index e76b7fb77..20d7e4a75 100644 --- a/spacy/pipeline/morphologizer.pyx +++ b/spacy/pipeline/morphologizer.pyx @@ -165,7 +165,7 @@ class Morphologizer(Tagger): docs (Iterable[Doc]): The documents to modify. batch_tag_ids: The IDs to set, produced by Morphologizer.predict. - DOCS: https://spacy.io/api/morphologizer#predict + DOCS: https://spacy.io/api/morphologizer#set_annotations """ if isinstance(docs, Doc): docs = [docs] diff --git a/spacy/pipeline/pipe.pyx b/spacy/pipeline/pipe.pyx index e4f7989b8..59c5f209e 100644 --- a/spacy/pipeline/pipe.pyx +++ b/spacy/pipeline/pipe.pyx @@ -32,7 +32,9 @@ class Pipe: raise NotImplementedError def __call__(self, Doc doc): - """Add context-sensitive embeddings to the Doc.tensor attribute. + """Apply the pipe to one document. The document is modified in place, + and returned. This usually happens under the hood when the nlp object + is called on a text and all components are applied to the Doc. docs (Doc): The Doc to preocess. RETURNS (Doc): The processed Doc. @@ -74,9 +76,9 @@ class Pipe: """Modify a batch of documents, using pre-computed scores. docs (Iterable[Doc]): The documents to modify. - tokvecses: The tensors to set, produced by Pipe.predict. + scores: The scores to assign. - DOCS: https://spacy.io/api/pipe#predict + DOCS: https://spacy.io/api/pipe#set_annotations """ raise NotImplementedError diff --git a/spacy/pipeline/senter.pyx b/spacy/pipeline/senter.pyx index 568e6031b..725af7e4e 100644 --- a/spacy/pipeline/senter.pyx +++ b/spacy/pipeline/senter.pyx @@ -76,7 +76,7 @@ class SentenceRecognizer(Tagger): docs (Iterable[Doc]): The documents to modify. batch_tag_ids: The IDs to set, produced by SentenceRecognizer.predict. - DOCS: https://spacy.io/api/sentencerecognizer#predict + DOCS: https://spacy.io/api/sentencerecognizer#set_annotations """ if isinstance(docs, Doc): docs = [docs] diff --git a/spacy/pipeline/tagger.pyx b/spacy/pipeline/tagger.pyx index b3f996acb..84f4a0312 100644 --- a/spacy/pipeline/tagger.pyx +++ b/spacy/pipeline/tagger.pyx @@ -145,7 +145,7 @@ class Tagger(Pipe): docs (Iterable[Doc]): The documents to modify. batch_tag_ids: The IDs to set, produced by Tagger.predict. - DOCS: https://spacy.io/api/tagger#predict + DOCS: https://spacy.io/api/tagger#set_annotations """ if isinstance(docs, Doc): docs = [docs] diff --git a/spacy/pipeline/textcat.py b/spacy/pipeline/textcat.py index c235a2594..2c399defc 100644 --- a/spacy/pipeline/textcat.py +++ b/spacy/pipeline/textcat.py @@ -163,7 +163,7 @@ class TextCategorizer(Pipe): docs (Iterable[Doc]): The documents to modify. scores: The scores to set, produced by TextCategorizer.predict. - DOCS: https://spacy.io/api/textcategorizer#predict + DOCS: https://spacy.io/api/textcategorizer#set_annotations """ for i, doc in enumerate(docs): for j, label in enumerate(self.labels): diff --git a/spacy/pipeline/tok2vec.py b/spacy/pipeline/tok2vec.py index 5e9e5b40e..b147cf177 100644 --- a/spacy/pipeline/tok2vec.py +++ b/spacy/pipeline/tok2vec.py @@ -109,7 +109,7 @@ class Tok2Vec(Pipe): docs (Iterable[Doc]): The documents to modify. tokvecses: The tensors to set, produced by Tok2Vec.predict. - DOCS: https://spacy.io/api/tok2vec#predict + DOCS: https://spacy.io/api/tok2vec#set_annotations """ for doc, tokvecs in zip(docs, tokvecses): assert tokvecs.shape[0] == len(doc) diff --git a/spacy/tokens/_serialize.py b/spacy/tokens/_serialize.py index bc371199a..192067ed4 100644 --- a/spacy/tokens/_serialize.py +++ b/spacy/tokens/_serialize.py @@ -50,7 +50,7 @@ class DocBin: self, attrs: Iterable[str] = ALL_ATTRS, store_user_data: bool = False, - docs: Iterable[Doc]=[], + docs: Iterable[Doc] = tuple(), ) -> None: """Create a DocBin object to hold serialized annotations.