mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Improve consistency of docs examples [ci skip]
This commit is contained in:
parent
784a5f4284
commit
1fa6d6ba55
|
@ -11,6 +11,11 @@ compressed binary strings. The `Doc` object holds an array of `TokenC]` structs.
|
|||
The Python-level `Token` and [`Span`](/api/span) objects are views of this
|
||||
array, i.e. they don't own the data themselves.
|
||||
|
||||
## Doc.\_\_init\_\_ {#init tag="method"}
|
||||
|
||||
Construct a `Doc` object. The most common way to get a `Doc` object is via the
|
||||
`nlp` object.
|
||||
|
||||
> #### Example
|
||||
>
|
||||
> ```python
|
||||
|
@ -24,11 +29,6 @@ array, i.e. they don't own the data themselves.
|
|||
> doc = Doc(nlp.vocab, words=words, spaces=spaces)
|
||||
> ```
|
||||
|
||||
## Doc.\_\_init\_\_ {#init tag="method"}
|
||||
|
||||
Construct a `Doc` object. The most common way to get a `Doc` object is via the
|
||||
`nlp` object.
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `vocab` | `Vocab` | A storage container for lexical types. |
|
||||
|
|
|
@ -29,7 +29,7 @@ class. The data will be loaded in via
|
|||
> nlp = spacy.load("/path/to/en") # unicode path
|
||||
> nlp = spacy.load(Path("/path/to/en")) # pathlib Path
|
||||
>
|
||||
> nlp = spacy.load("en", disable=["parser", "tagger"])
|
||||
> nlp = spacy.load("en_core_web_sm", disable=["parser", "tagger"])
|
||||
> ```
|
||||
|
||||
| Name | Type | Description |
|
||||
|
|
|
@ -182,8 +182,8 @@ initializing a Language class via [`from_disk`](/api/language#from_disk).
|
|||
- nlp = spacy.load('en', tagger=False, entity=False)
|
||||
- doc = nlp(u"I don't want parsed", parse=False)
|
||||
|
||||
+ nlp = spacy.load('en', disable=['ner'])
|
||||
+ nlp.remove_pipe('parser')
|
||||
+ nlp = spacy.load("en", disable=["ner"])
|
||||
+ nlp.remove_pipe("parser")
|
||||
+ doc = nlp(u"I don't want parsed")
|
||||
```
|
||||
|
||||
|
|
|
@ -623,8 +623,8 @@ solves this with a clear distinction between setting up the instance and loading
|
|||
the data.
|
||||
|
||||
```diff
|
||||
- nlp = spacy.load("en", path="/path/to/data")
|
||||
+ nlp = spacy.blank("en").from_disk("/path/to/data")
|
||||
- nlp = spacy.load("en_core_web_sm", path="/path/to/data")
|
||||
+ nlp = spacy.blank("en_core_web_sm").from_disk("/path/to/data")
|
||||
```
|
||||
|
||||
</Infobox>
|
||||
|
|
Loading…
Reference in New Issue
Block a user