class_docstr: Vocabulary basically contains mapping between numbers and tokens and vice versa.
  
  Parameters
  ----------
  idx2tok: List[str], required
      List of tokens where list indices are corresponding to
      their mapped integer indices.
  
  use_special_tokens: bool, optional, default: False
      If `True`, vocabulary will include `SPECIAL_TOKENS`.
class_docstr_tok: ["Vocabulary","basically","contains","mapping","between","numbers","and","tokens","and","vice","versa",".","Parameters","--","--","--","--","--","idx2tok",":","List","[","str","]",",","required","List","of","tokens","where","list","indices","are","corresponding","to","their","mapped","integer","indices",".","use_special_tokens",":","bool",",","optional",",","default",":","False","If","`","True","`",",","vocabulary","will","include","`","SPECIAL_TOKENS","`","."]
docstr: Build a mapping between tokens to their integer indices
docstr_tok: ["Build","a","mapping","between","tokens","to","their","integer","indices"]
code: def build_tok2idx(self):
      """
      Build a mapping between tokens to their integer indices
      """
      self.tok2idx = defaultdict(
          int, {tok: idx for idx, tok in enumerate(self.idx2tok)}
      )
  
imports: from typing import List, Dict, Callable, Union
  from collections import defaultdict, Counter, OrderedDict
  import string
  import pickle
  import re
  import numpy
  import scipy.sparse
  from .None import FeatureModality
  from .modality import fallback_feature
  from ..utils import normalize
label_desc: Use image node_id 2 for calling the Vocabulary obj's underlying member method code with example usage: obj.build_tok2idx() without return types