code: def __init__(
      self,
      vocab_list,
      unk_idx: int = 0,
      pad_idx: int = -1,
      bos_idx: int = -1,
      eos_idx: int = -1,
      mask_idx: int = -1,
      unk_token: Optional[str] = None,
  ):
      super().__init__()
      self.vocab: List[str] = vocab_list
      self.unk_idx: int = unk_idx
      self.pad_idx: int = pad_idx
      self.eos_idx: int = eos_idx
      self.bos_idx: int = bos_idx
      self.mask_idx: int = mask_idx
      self.idx: Dict[str, int] = {
          word: i for i, word in enumerate(vocab_list)
      }
      pad_token = (
          vocab_list[pad_idx] if pad_idx >= 0 else SpecialTokens.PAD
      )
      self.pad_token: str = pad_token
      self.unk_token = unk_token
  
file_path: pytext/pytext/torchscript/vocab.py
imports: from typing import Dict, List, Optional
  import torch
  import torch.nn
  from pytext.common.constants import SpecialTokens
label_desc: Use image node_id 1 to create a new ScriptVocabulary object from inherited base classes: nn with example: obj = ScriptVocabulary(vocab_list, unk_idx, pad_idx, bos_idx, eos_idx, mask_idx, unk_token)