spaCy/website/docs/api
Adriane Boyd 7e4cd7575c
Refactor Docs.is_ flags (#6044)
* Refactor Docs.is_ flags

* Add derived `Doc.has_annotation` method

  * `Doc.has_annotation(attr)` returns `True` for partial annotation

  * `Doc.has_annotation(attr, require_complete=True)` returns `True` for
    complete annotation

* Add deprecation warnings to `is_tagged`, `is_parsed`, `is_sentenced`
and `is_nered`

* Add `Doc._get_array_attrs()`, which returns a full list of `Doc` attrs
for use with `Doc.to_array`, `Doc.to_bytes` and `Doc.from_docs`. The
list is the `DocBin` attributes list plus `SPACY` and `LENGTH`.

Notes on `Doc.has_annotation`:

* `HEAD` is converted to `DEP` because heads don't have an unset state

* Accept `IS_SENT_START` as a synonym of `SENT_START`

Additional changes:

* Add `NORM`, `ENT_ID` and `SENT_START` to default attributes for
`DocBin`

* In `Doc.from_array()` the presence of `DEP` causes `HEAD` to override
`SENT_START`

* In `Doc.from_array()` using `attrs` other than
`Doc._get_array_attrs()` (i.e., a user's custom list rather than our
default internal list) with both `HEAD` and `SENT_START` shows a warning
that `HEAD` will override `SENT_START`

* `set_children_from_heads` does not require dependency labels to set
sentence boundaries and sets `sent_start` for all non-sentence starts to
`-1`

* Fix call to set_children_form_heads

Co-authored-by: Matthew Honnibal <honnibal+gh@gmail.com>
2020-09-17 00:14:01 +02:00
..
architectures.md Merge pull request #6045 from svlandeg/feature/more-layers-docs [ci skip] 2020-09-09 21:46:40 +02:00
attributeruler.md Update docs [ci skip] 2020-09-12 17:05:10 +02:00
cli.md Update docs and consistency [ci skip] 2020-09-15 00:32:49 +02:00
corpus.md Update docs and consistency [ci skip] 2020-09-15 00:32:49 +02:00
cython-classes.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00
cython-structs.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00
cython.md Update docs [ci skip] 2020-09-12 17:05:10 +02:00
data-formats.md Update docs and consistency [ci skip] 2020-09-15 00:32:49 +02:00
dependencymatcher.md doc fixes 2020-09-12 17:38:54 +02:00
dependencyparser.md doc fixes 2020-09-12 17:38:54 +02:00
doc.md Refactor Docs.is_ flags (#6044) 2020-09-17 00:14:01 +02:00
docbin.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00
entitylinker.md doc fixes 2020-09-12 17:38:54 +02:00
entityrecognizer.md doc fixes 2020-09-12 17:38:54 +02:00
entityruler.md doc fixes 2020-09-12 17:38:54 +02:00
example.md Update docs [ci skip] 2020-09-12 17:05:10 +02:00
index.md Update v3 docs 2020-07-03 16:48:21 +02:00
kb.md Define candidate generator in EL config (#5876) 2020-08-18 16:10:36 +02:00
language.md Update docs 2020-09-15 11:41:49 +02:00
lemmatizer.md doc fixes 2020-09-12 17:38:54 +02:00
lexeme.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00
lookups.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00
matcher.md Deprecate (Phrase)Matcher.pipe 2020-08-31 17:01:24 +02:00
morphologizer.md doc fixes 2020-09-12 17:38:54 +02:00
morphology.md Update docs [ci skip] 2020-08-21 13:22:59 +02:00
phrasematcher.md doc fixes 2020-09-12 17:38:54 +02:00
pipe.md doc fixes 2020-09-12 17:38:54 +02:00
pipeline-functions.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00
scorer.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00
sentencerecognizer.md doc fixes 2020-09-12 17:38:54 +02:00
sentencizer.md doc fixes 2020-09-12 17:38:54 +02:00
span.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00
stringstore.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00
tagger.md doc fixes 2020-09-12 17:38:54 +02:00
textcategorizer.md positive_label config for textcat (#6062) 2020-09-14 17:08:00 +02:00
tok2vec.md doc fixes 2020-09-12 17:38:54 +02:00
token.md Update docs [ci skip] 2020-08-21 13:22:59 +02:00
tokenizer.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00
top-level.md Update docs 2020-09-15 11:41:49 +02:00
transformer.md Update docs [ci skip] 2020-09-12 17:05:10 +02:00
vectors.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00
vocab.md Update docs, types and API consistency 2020-08-17 16:45:24 +02:00