spaCy/spacy/lang
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
..
af Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
am Update Tigrinya ትግርኛ language support (#8900) 2021-08-10 13:55:08 +02:00
ar Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
az Fix Azerbaijani init, extend lang init tests (#8656) 2021-07-09 15:36:35 +02:00
bg Improve the stop words and the tokenizer exceptions in Bulgarian language. (#8862) 2021-08-10 13:44:23 +02:00
bn Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
ca Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
cs Tidy up and auto-format 2021-01-05 13:41:53 +11:00
da Merge remote-tracking branch 'upstream/master' into chore/update-develop-from-master-rc3 2021-01-14 11:49:58 +01:00
de Merge branch 'develop' into master-tmp 2020-10-04 14:52:20 +02:00
el Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
en Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
es Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
et Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
eu Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
fa Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
fi Tidy up code 2021-06-28 12:08:15 +02:00
fr Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
ga Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
grc Remove extraneous grc test file (#8768) 2021-07-20 15:51:15 +02:00
gu Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
he raise NotImplementedError when noun_chunks iterator is not implemented (#6711) 2021-01-17 19:56:05 +08:00
hi Auto-format [ci skip] 2020-10-15 10:08:53 +02:00
hr Remove tag map 2020-12-09 11:13:49 +11:00
hu Fix Hungarian % tokenization (#6013) 2020-09-02 13:06:16 +02:00
hy Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
id Merge branch 'develop' into master-tmp 2020-10-04 14:52:20 +02:00
is Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
it Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
ja Add lexeme norm defaults 2020-09-30 10:20:14 +02:00
kn Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
ko Add lexeme norm defaults 2020-09-30 10:20:14 +02:00
ky Tidy up and auto-format 2021-01-30 12:52:33 +11:00
lb Remove default initialize lookups 2020-10-01 21:54:33 +02:00
lij Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
lt Fix escape sequence 2021-01-30 12:39:58 +11:00
lv Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
mk Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
ml Add missing lex_attr_getters (resolves #5806 ) 2020-07-25 12:55:18 +02:00
mr Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
nb Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
ne Remove unicode declarations and update language data 2020-09-04 13:19:16 +02:00
nl Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
pl Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
pt Tidy up and auto-format 2021-01-15 11:57:36 +11:00
ro Merge remote-tracking branch 'upstream/master' into chore/update-develop-from-master-rc3 2021-01-14 11:49:58 +01:00
ru Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
sa Tidy up and auto-format 2020-09-29 21:39:28 +02:00
si Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
sk Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
sl Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
sq Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
sr Remove default initialize lookups 2020-10-01 21:54:33 +02:00
sv Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
ta Merge branch 'develop' into master-tmp 2020-10-15 09:06:03 +02:00
te Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
th Add Thai tag map (LST20 Corpus) (#6163) 2020-10-07 11:12:01 +02:00
ti Update Tigrinya ትግርኛ language support (#8900) 2021-08-10 13:55:08 +02:00
tl Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
tn Tidy up and auto-format 2021-02-13 12:55:56 +11:00
tr Tidy up and auto-format 2021-01-05 13:41:53 +11:00
tt Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
uk Refactor scoring methods to use registered functions (#8766) 2021-08-10 15:13:39 +02:00
ur Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
vi Update Vietnamese tokenizer (#8099) 2021-05-17 18:16:20 +10:00
xx Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
yo Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
zh Setup / install / quickstart updates 2020-10-23 11:27:54 +02:00
__init__.py Remove imports in /lang/__init__.py 2017-05-08 23:58:07 +02:00
char_classes.py Add all symbols in Unicode Currency Symbols block (#8212) 2021-05-31 18:03:40 +10:00
lex_attrs.py Use tokenizer URL_MATCH pattern in LIKE_URL (#8765) 2021-07-27 12:07:01 +02:00
norm_exceptions.py Tidy up and auto-format 2020-02-18 15:38:18 +01:00
punctuation.py Simplify language data and revert detailed configs 2020-07-24 14:50:26 +02:00
tokenizer_exceptions.py Tidy up with flake8: imports, comparisons, etc. 2021-06-28 12:08:15 +02:00