From 9deaac9786a8dd47aa246ba3ef53dc5924d646ab Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Mon, 30 Oct 2023 17:02:08 +0100 Subject: [PATCH] Add note in docs on `score_weight` config if using a non-default `spans_key` for SpanCat (#13093) * Add note on score_weight if using a non-default span_key for SpanCat. * Fix formatting. * Fix formatting. * Fix typo. * Use warning infobox. * Fix infobox formatting. --- website/docs/api/spancategorizer.mdx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/website/docs/api/spancategorizer.mdx b/website/docs/api/spancategorizer.mdx index bfe33dfb9..8c8a71256 100644 --- a/website/docs/api/spancategorizer.mdx +++ b/website/docs/api/spancategorizer.mdx @@ -89,6 +89,20 @@ architectures and their arguments and hyperparameters. | `negative_weight` 3.5.1 | Multiplier for the loss terms. It can be used to downweight the negative samples if there are too many. It is only used when `add_negative_label` is `True`. Defaults to `1.0`. ~~float~~ | | `allow_overlap` 3.5.1 | If `True`, the data is assumed to contain overlapping spans. It is only available when `max_positive` is exactly 1. Defaults to `True`. ~~bool~~ | + + +If you set a non-default value for `spans_key`, you'll have to update +`[training.score_weights]` as well so that weights are computed properly. E. g. for `span_key == "myspankey"`, include this in your config: + +```ini +[training.score_weights] +spans_myspankey_f = 1.0 +spans_myspankey_p = 0.0 +spans_myspankey_r = 0.0 +``` + + + ```python %%GITHUB_SPACY/spacy/pipeline/spancat.py ```