class_docstr: Builds and/or loads a dictionary.
  
  All code is TorchScriptable.
class_docstr_tok: ["Builds","and\/or","loads","a","dictionary",".","All","code","is","TorchScriptable","."]
code: def __init__(
      self,
      null_token: str,
      end_token: str,
      unk_token: str,
      start_token: str,
      freq: Dict[str, int],
      tok2ind: Dict[str, int],
      ind2tok: Dict[int, str],
      bpe_add_prefix_space: bool,
      bpe_encoder: Dict[str, str],
      bpe_byte_encoder: Dict[int, str],
      fused_key_bpe_ranks: Dict[str, float],
      special_tokens: List[str],
      subword_bpe_version: Tuple[int, int],
      fused_bpe_codes: Dict[str, float],
      subword_bpe_separator: str,
  ):
      self.null_token = null_token
      self.end_token = end_token
      self.unk_token = unk_token
      self.start_token = start_token
  
      self.freq = freq
      self.tok2ind = tok2ind
      self.ind2tok = ind2tok
  
      # cache unk token for later
      self._unk_token_idx = self.tok2ind[self.unk_token]
  
      # Initialize tokenizer
      self.subword_bpe = ScriptableSubwordBpeHelper(
          add_prefix_space=bpe_add_prefix_space,
          version=subword_bpe_version,
          bpe_codes=fused_bpe_codes,
          separator=subword_bpe_separator,
      )
  
      self.gpt2_bpe = ScriptableGpt2BpeHelper(
          add_prefix_space=bpe_add_prefix_space,
          encoder=bpe_encoder,
          byte_encoder=bpe_byte_encoder,
          fused_key_bpe_ranks=fused_key_bpe_ranks,
          special_tokens=special_tokens,
      )
  
imports: from typing import Dict, List, Tuple
  import torch.jit
label_desc: Use image node_id 1 to create a new ScriptableDictionaryAgent object  with example: obj = ScriptableDictionaryAgent(null_token, end_token, unk_token, start_token, freq, tok2ind, ind2tok, bpe_add_prefix_space, bpe_encoder, bpe_byte_encoder, fused_key_bpe_ranks, special_tokens, subword_bpe_version, fused_bpe_codes, subword_bpe_separator)