spaCy/spacy/tokens
Adriane Boyd a4b32b9552
Handle missing reference values in scorer (#6286)
* Handle missing reference values in scorer

Handle missing values in reference doc during scoring where it is
possible to detect an unset state for the attribute. If no reference
docs contain annotation, `None` is returned instead of a score. `spacy
evaluate` displays `-` for missing scores and the missing scores are
saved as `None`/`null` in the metrics.

Attributes without unset states:

* `token.head`: relies on `token.dep` to recognize unset values
* `doc.cats`: unable to handle missing annotation

Additional changes:

* add optional `has_annotation` check to `score_scans` to replace
`doc.sents` hack
* update `score_token_attr_per_feat` to handle missing and empty morph
representations
* fix bug in `Doc.has_annotation` for normalization of `IS_SENT_START`
vs. `SENT_START`

* Fix import

* Update return types
2020-11-03 15:47:18 +01:00
..
__init__.pxd * Break up tokens.pyx into tokens/doc.pyx, tokens/token.pyx, tokens/spans.pyx 2015-07-13 20:20:58 +02:00
__init__.py Modify morphology to support arbitrary features (#4932) 2020-01-23 22:01:54 +01:00
_retokenize.pyx Merge branch 'develop' into master-tmp 2020-10-04 14:52:20 +02:00
_serialize.py small UX fix for DocBin (#6167) 2020-10-02 15:43:32 +02:00
doc.pxd Refactor Docs.is_ flags (#6044) 2020-09-17 00:14:01 +02:00
doc.pyx Handle missing reference values in scorer (#6286) 2020-11-03 15:47:18 +01:00
morphanalysis.pxd Modify morphology to support arbitrary features (#4932) 2020-01-23 22:01:54 +01:00
morphanalysis.pyx Minor refactor for Morphology and MorphAnalysis (#5804) 2020-07-24 09:28:06 +02:00
span.pxd Remove Span._recalculate_indices 2020-10-09 14:42:51 +02:00
span.pyx Remove Span._recalculate_indices 2020-10-09 14:42:51 +02:00
token.pxd Tidy up compiler flags and imports (#5071) 2020-03-02 11:48:10 +01:00
token.pyx Also accept MorphAnalysis in set_morph 2020-10-02 08:33:43 +02:00
underscore.py Remove object subclassing 2020-07-12 14:03:23 +02:00