class_docstr: Wrapper of the Spacy Tokenizer.
  
  Users of this class are required to install `spaCy <https://spacy.io/usage/>`_
  and download corresponding NLP models, such as :samp:`python -m spacy download en`.
  
  Only spacy>=2.0.0 is supported.
  
  Parameters
  ----------
  lang
      The language of the input. If we just specify the lang and do not specify the model,
      we will provide the tokenizer with pre-selected models.
  model
      The language to tokenize. Default is None, and we will choose the tokenizer
      automatically based on the language:
  
      - en --> 'en_core_web_sm'
      - de --> 'de_core_news_sm'
      - fr --> 'fr_core_news_sm'
      - ja --> 'ja_core_news_sm'
  
      For more details about how to set this flag, you may refer to
      https://spacy.io/usage/models for supported languages.
  
      Also, you may refer to https://github.com/explosion/spacy-models/blob/master/compatibility.json
  
  vocab
      The vocabulary of the tokenizer. Can be optional. You must specify this if you will need to map
      the raw text into integers.
  
  Examples
  --------
  >>> import gluonnlp
  >>> tokenizer = gluonnlp.data.SpacyTokenizer()
  >>> tokenizer.encode('Gluon NLP toolkit provides a suite of text processing tools.')
  ['Gluon', 'NLP', 'toolkit', 'provides', 'a', 'suite', 'of', 'text', 'processing', 'tools', '.']
  >>> tokenizer = gluonnlp.data.SpacyTokenizer('de')
  >>> tokenizer.encode('Das Gluon NLP-Toolkit stellt eine Reihe von Textverarbeitungstools'
  ...                  ' zur Verfügung.')
  ['Das', 'Gluon', 'NLP-Toolkit', 'stellt', 'eine', 'Reihe', 'von', 'Textverarbeitungstools', \
  'zur', 'Verfügung', '.']
  >>> tokenizer = gluonnlp.data.SpacyTokenizer(model='de_core_news_sm')
  >>> tokenizer.encode('Das Gluon NLP-Toolkit stellt eine Reihe von Textverarbeitungstools'
  ...                  ' zur Verfügung.')
  ['Das', 'Gluon', 'NLP-Toolkit', 'stellt', 'eine', 'Reihe', 'von', 'Textverarbeitungstools', \
  'zur', 'Verfügung', '.']
class_docstr_tok: ["Wrapper","of","the","Spacy","Tokenizer",".","Users","of","this","class","are","required","to","install","`","spaCy","<","https",":","\/\/spacy.io\/usage\/",">","`","_","and","download","corresponding","NLP","models",",","such","as",":","samp",":","`","python","-m","spacy","download","en","`",".","Only","spacy",">","=2.0.0","is","supported",".","Parameters","--","--","--","--","--","lang","The","language","of","the","input",".","If","we","just","specify","the","lang","and","do","not","specify","the","model",",","we","will","provide","the","tokenizer","with","pre-selected","models",".","model","The","language","to","tokenize",".","Default","is","None",",","and","we","will","choose","the","tokenizer","automatically","based","on","the","language",":","-","en","--",">","'en_core_web_sm'","-","de","--",">","'de_core_news_sm'","-","fr","--",">","'fr_core_news_sm'","-","ja","--",">","'ja_core_news_sm'","For","more","details","about","how","to","set","this","flag",",","you","may","refer","to","https",":","\/\/spacy.io\/usage\/models","for","supported","languages",".","Also",",","you","may","refer","to","https",":","\/\/github.com\/explosion\/spacy-models\/blob\/master\/compatibility.json","vocab","The","vocabulary","of","the","tokenizer",".","Can","be","optional",".","You","must","specify","this","if","you","will","need","to","map","the","raw","text","into","integers",".","Examples","--","--","--","--",">",">",">","import","gluonnlp",">",">",">","tokenizer","=","gluonnlp.data.SpacyTokenizer","(",")",">",">",">","tokenizer.encode","(","'Gluon","NLP","toolkit","provides","a","suite","of","text","processing","tools",".","'",")","[","'Gluon","'",",","'NLP","'",",","'toolkit","'",",","'provides","'",",","'","a","'",",","'suite","'",",","'of","'",",","'text","'",",","'processing","'",",","'tools","'",",","'",".","'","]",">",">",">","tokenizer","=","gluonnlp.data.SpacyTokenizer","(","'de","'",")",">",">",">","tokenizer.encode","(","'Das","Gluon","NLP-Toolkit","stellt","eine","Reihe","von","Textverarbeitungstools'","...","'","zur","Verf\u00fcgung",".","'",")","[","'Das","'",",","'Gluon","'",",","'NLP-Toolkit","'",",","'stellt","'",",","'eine","'",",","'Reihe","'",",","'von","'",",","'Textverarbeitungstools","'",",","\\","'zur","'",",","'Verf\u00fcgung","'",",","'",".","'","]",">",">",">","tokenizer","=","gluonnlp.data.SpacyTokenizer","(","model='de_core_news_sm","'",")",">",">",">","tokenizer.encode","(","'Das","Gluon","NLP-Toolkit","stellt","eine","Reihe","von","Textverarbeitungstools'","...","'","zur","Verf\u00fcgung",".","'",")","[","'Das","'",",","'Gluon","'",",","'NLP-Toolkit","'",",","'stellt","'",",","'eine","'",",","'Reihe","'",",","'von","'",",","'Textverarbeitungstools","'",",","\\","'zur","'",",","'Verf\u00fcgung","'",",","'",".","'","]"]
docstr: Set the vocabulary of the tokenizer
  
  Parameters
  ----------
  vocab
      Update the inner vocabulary of the tokenizer to the given vocabulary.
docstr_tok: ["Set","the","vocabulary","of","the","tokenizer","Parameters","--","--","--","--","--","vocab","Update","the","inner","vocabulary","of","the","tokenizer","to","the","given","vocabulary","."]
code: def set_vocab(self, vocab: Vocab):
      """Set the vocabulary of the tokenizer
  
      Parameters
      ----------
      vocab
          Update the inner vocabulary of the tokenizer to the given vocabulary.
      """
      self._vocab = vocab
  
file_path: gluon-nlp/src/gluonnlp/data/tokenizers/spacy.py
imports: from typing import Optional
  from .base import TOKENIZER_REGISTRY, BaseTokenizerWithVocab, TokenizerEncodeWithoutVocabError, TokenTypeNotSupportedError, SentencesType
  from ..vocab import Vocab
  from ...utils.lazy_imports import try_import_spacy
label_desc: Use image node_id 7 for calling the SpacyTokenizer obj's underlying member method code with example usage: obj.set_vocab(vocab) without return types