Add examples to docs. Rename _nlp to nlp in tests.

This commit is contained in:
Raphael Mitsch 2022-11-17 12:56:14 +01:00
parent 3f9d879bfe
commit dd84d651c9
2 changed files with 13 additions and 4 deletions

View File

@ -883,7 +883,7 @@ def test_cli_find_threshold(capsys):
},
),
]:
doc = _nlp.make_doc(t[0])
doc = nlp.make_doc(t[0])
docs.append(Example.from_dict(doc, t[1]))
return docs

View File

@ -1175,9 +1175,18 @@ thresholds - e.g. `textcat_multilabel` and `spancat`, but not `textcat`. Note
that the full path to the corresponding threshold attribute in the config has to
be provided.
```cli
$ python -m spacy find-threshold [model] [data_path] [pipe_name] [threshold_key] [scores_key] [--n_trials] [--code] [--use-gpu] [--gold-preproc] [--verbose]
```
> #### Examples
>
> ```cli
> # For textcat_multilabel:
> $ python -m spacy find-threshold my_nlp data.spacy textcat_multilabel threshold cats_macro_f
> ```
>
> ```cli
> # For spancat:
> $ python -m spacy find-threshold my_nlp data.spacy spancat threshold spans_sc_f
> ```
| Name | Description |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |