mirror of
https://github.com/explosion/spaCy.git
synced 2025-07-11 08:42:28 +03:00
Clarify vocab docs (#13273)
* add line to ensure that apple is in fact in the vocab * add that the vocab may be empty
This commit is contained in:
parent
c749eb5570
commit
259b9dd593
|
@ -13,7 +13,7 @@ between `Doc` objects.
|
||||||
<Infobox variant ="warning">
|
<Infobox variant ="warning">
|
||||||
|
|
||||||
Note that a `Vocab` instance is not static. It increases in size as texts with
|
Note that a `Vocab` instance is not static. It increases in size as texts with
|
||||||
new tokens are processed.
|
new tokens are processed. Some models may have an empty vocab at initialization.
|
||||||
|
|
||||||
</Infobox>
|
</Infobox>
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ given string, you need to look it up in
|
||||||
> #### Example
|
> #### Example
|
||||||
>
|
>
|
||||||
> ```python
|
> ```python
|
||||||
|
> nlp("I'm eating an apple")
|
||||||
> apple = nlp.vocab.strings["apple"]
|
> apple = nlp.vocab.strings["apple"]
|
||||||
> oov = nlp.vocab.strings["dskfodkfos"]
|
> oov = nlp.vocab.strings["dskfodkfos"]
|
||||||
> assert apple in nlp.vocab
|
> assert apple in nlp.vocab
|
||||||
|
|
Loading…
Reference in New Issue
Block a user