From 7496e03a2c18c24454af924347af667e6df0ac70 Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Fri, 26 Jan 2024 10:58:48 +0100 Subject: [PATCH] Clarify vocab docs (#13273) * add line to ensure that apple is in fact in the vocab * add that the vocab may be empty --- website/docs/api/vocab.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/docs/api/vocab.mdx b/website/docs/api/vocab.mdx index fe774d1a8..57618397d 100644 --- a/website/docs/api/vocab.mdx +++ b/website/docs/api/vocab.mdx @@ -13,7 +13,7 @@ between `Doc` objects. 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. @@ -93,6 +93,7 @@ given string, you need to look it up in > #### Example > > ```python +> nlp("I'm eating an apple") > apple = nlp.vocab.strings["apple"] > oov = nlp.vocab.strings["dskfodkfos"] > assert apple in nlp.vocab