From 2524d067fdcda8f581faca6966626f2572b63342 Mon Sep 17 00:00:00 2001 From: Paul O'Leary McCann Date: Fri, 10 Feb 2023 15:12:53 +0900 Subject: [PATCH] Add links to docs in docstrings --- spacy/cli/configure.py | 12 ++++++++++-- spacy/cli/merge.py | 11 ++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/spacy/cli/configure.py b/spacy/cli/configure.py index cc36924bc..bfbcafb31 100644 --- a/spacy/cli/configure.py +++ b/spacy/cli/configure.py @@ -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) diff --git a/spacy/cli/merge.py b/spacy/cli/merge.py index 8ad909bfc..4ee2b3a00 100644 --- a/spacy/cli/merge.py +++ b/spacy/cli/merge.py @@ -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)