Add links to docs in docstrings

This commit is contained in:
Paul O'Leary McCann 2023-02-10 15:12:53 +09:00
parent c0a3e9a44a
commit 2524d067fd
2 changed files with 20 additions and 3 deletions

View File

@ -103,6 +103,8 @@ def configure_resume_cli(
A config for resuming training is the same as the input config, but with
all components sourced.
DOCS: https://spacy.io/api/cli#configure-resume
"""
nlp = spacy.load(base_model)
@ -127,7 +129,10 @@ def configure_resume_cli(
def configure_transformer_feature_source(
base_model: str, output_file: Path, transformer_name: str = "roberta-base"
) -> Config:
"""Replace pipeline tok2vec with transformer."""
"""Replace pipeline tok2vec with transformer.
DOCS: https://spacy.io/api/cli#configure-transformer
"""
# 1. identify tok2vec
# 2. replace tok2vec
@ -176,7 +181,10 @@ def configure_transformer_feature_source(
@configure_cli.command("tok2vec")
def configure_tok2vec_feature_source(base_model: str, output_file: Path) -> Config:
"""Replace pipeline tok2vec with CNN tok2vec."""
"""Replace pipeline tok2vec with CNN tok2vec.
DOCS: https://spacy.io/api/cli#configure-tok2vec
"""
nlp = spacy.load(base_model)
_check_single_tok2vec(base_model, nlp.config)

View File

@ -109,7 +109,16 @@ def merge_pipelines(
output_file: Path = Arg(..., help="Path to save merged model")
# fmt: on
) -> Language:
"""Combine components from multiple pipelines."""
"""Combine components from multiple pipelines.
Given two pipelines, the components from them are merged into a single
pipeline. The exact way this works depends on whether the second pipeline
has one listener or more than one listener. In the single listener case
`replace_listeners` is used, otherwise components are simply appended to
the base pipeline.
DOCS: https://spacy.io/api/cli#merge
"""
nlp = spacy.load(base_model)
nlp2 = spacy.load(added_model)