class_docstr: A mapping from indices to vocab elements.
class_docstr_tok: ["A","mapping","from","indices","to","vocab","elements","."]
code: def __init__(
      self,
      vocab_list: List[str],
      counts: List = None,
      replacements: Optional[Dict[str, str]] = None,
      unk_token: str = SpecialTokens.UNK,
      pad_token: str = SpecialTokens.PAD,
      bos_token: str = SpecialTokens.BOS,
      eos_token: str = SpecialTokens.EOS,
      mask_token: str = SpecialTokens.MASK,
  ):
      self._vocab = vocab_list
      self.counts = counts
      self.idx = {word: i for i, word in enumerate(vocab_list)}
      self.names = {i: word for i, word in enumerate(vocab_list)}
      self.unk_token = unk_token
      self.pad_token = pad_token
      self.bos_token = bos_token
      self.eos_token = eos_token
      self.mask_token = mask_token
      if replacements:
          self.replace_tokens(replacements)
      self.unk_token_counter = [
          0,
          0,
      ]  # count of unk tokens, total tokens
      # count of examples with least 75% unk tokens, total examples
      self.unk_example_counter = [0, 0]
      self.messages_printed = 0
  
imports: import itertools
  from collections import Counter
  from typing import Dict, List, Optional, Tuple
  import torch
  from pytext.common.constants import SpecialTokens, Token
  from pytext.utils import cuda, precision
label_desc: Use image node_id 1 to create a new Vocabulary object  with example: obj = Vocabulary(vocab_list, counts, replacements, unk_token, pad_token, bos_token, eos_token, mask_token)