spaCy/spacy/lang/en
Adriane Boyd f99d6d5e39
Refactor scoring methods to use registered functions (#8766)
* Add scorer option to components

Add an optional `scorer` parameter to all pipeline components. If a
scoring function is provided, it overrides the default scoring method
for that component.

* Add registered scorers for all components

* Add `scorers` registry
* Move all scoring methods outside of components as independent
  functions and register
* Use the registered scoring methods as defaults in configs and inits

Additional:

* The scoring methods no longer have access to the full component, so
  use settings from `cfg` as default scorer options to handle settings
  such as `labels`, `threshold`, and `positive_label`
* The `attribute_ruler` scoring method no longer has access to the
  patterns, so all scoring methods are called
* Bug fix: `spancat` scoring method is updated to set `allow_overlap` to
  score overlapping spans correctly

* Update Russian lemmatizer to use direct score method

* Check type of cfg in Pipe.score

* Fix check

* Update spacy/pipeline/sentencizer.pyx

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>

* Remove validate_examples from scoring functions

* Use Pipe.labels instead of Pipe.cfg["labels"]

Co-authored-by: Sofie Van Landeghem <svlandeg@users.noreply.github.com>
2021-08-10 15:13:39 +02:00
..
__init__.py Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
examples.py Tidy up and auto-format 2020-02-18 15:38:18 +01:00
lemmatizer.py Tidy up and auto-format 2020-09-29 21:39:28 +02:00
lex_attrs.py Fix/fix en ordinals (#8028) 2021-05-07 10:26:42 +02:00
punctuation.py Tidy up [ci skip] 2020-07-25 13:00:49 +02:00
stop_words.py Tidy up and auto-format 2020-02-18 15:38:18 +01:00
syntax_iterators.py Merge remote-tracking branch 'upstream/master' into chore/update-develop-from-master 2020-11-25 11:49:34 +01:00
tokenizer_exceptions.py Merge remote-tracking branch 'upstream/master' into chore/update-develop-from-master-rc3 2021-01-14 11:49:58 +01:00