Update docs [ci skip]

This commit is contained in:
Ines Montani 2020-09-22 09:45:41 +02:00
parent 6316d5f398
commit f9af7d365c
2 changed files with 9 additions and 7 deletions

View File

@ -187,7 +187,7 @@ more efficient than processing texts one-by-one.
> ```python > ```python
> texts = ["One document.", "...", "Lots of documents"] > texts = ["One document.", "...", "Lots of documents"]
> for doc in nlp.pipe(texts, batch_size=50): > for doc in nlp.pipe(texts, batch_size=50):
> assert doc.is_parsed > assert doc.has_annotation("DEP")
> ``` > ```
| Name | Description | | Name | Description |

View File

@ -205,9 +205,10 @@ acquired from [WordNet](https://wordnet.princeton.edu/).
spaCy features a fast and accurate syntactic dependency parser, and has a rich spaCy features a fast and accurate syntactic dependency parser, and has a rich
API for navigating the tree. The parser also powers the sentence boundary API for navigating the tree. The parser also powers the sentence boundary
detection, and lets you iterate over base noun phrases, or "chunks". You can detection, and lets you iterate over base noun phrases, or "chunks". You can
check whether a [`Doc`](/api/doc) object has been parsed with the check whether a [`Doc`](/api/doc) object has been parsed by calling
`doc.is_parsed` attribute, which returns a boolean value. If this attribute is `doc.has_annotation("DEP")`, which checks whether the attribute `Token.dep` has
`False`, the default sentence iterator will raise an exception. been set returns a boolean value. If the result is `False`, the default sentence
iterator will raise an exception.
<Infobox title="Dependency label scheme" emoji="📖"> <Infobox title="Dependency label scheme" emoji="📖">
@ -1705,9 +1706,10 @@ and can still be overwritten by the parser.
<Infobox title="Important note" variant="warning"> <Infobox title="Important note" variant="warning">
To prevent inconsistent state, you can only set boundaries **before** a document To prevent inconsistent state, you can only set boundaries **before** a document
is parsed (and `doc.is_parsed` is `False`). To ensure that your component is is parsed (and `doc.has_annotation("DEP")` is `False`). To ensure that your
added in the right place, you can set `before='parser'` or `first=True` when component is added in the right place, you can set `before='parser'` or
adding it to the pipeline using [`nlp.add_pipe`](/api/language#add_pipe). `first=True` when adding it to the pipeline using
[`nlp.add_pipe`](/api/language#add_pipe).
</Infobox> </Infobox>