class_docstr: Tokenizer transform abstract class.
docstr: Available options relate to Subword.
docstr_tok: ["Available","options","relate","to","Subword","."]
code: def add_options(cls, parser):
      """Available options relate to Subword."""
      # Sharing options among `TokenizerTransform`s, same name conflict in
      # this scope will be resolved by remove previous occurrence in parser
      group = parser.add_argument_group(
          "Transform/Subword/Common",
          conflict_handler="resolve",
          description=".. Attention:: Common options shared by all subword transforms. "  # noqa: E501
          "Including options for indicate subword model path, "
          "`Subword Regularization <https://arxiv.org/abs/1804.10959>`_"
          "/`BPE-Dropout <https://arxiv.org/abs/1910.13267>`_, "
          "and `Vocabulary Restriction <https://github.com/rsennrich/subword-nmt#best-practice-advice-for-byte-pair-encoding-in-nmt>`__.",  # noqa: E501
      )  # noqa: E501
      group.add(
          "-src_subword_model",
          "--src_subword_model",
          help="Path of subword model for src (or shared).",
      )
      group.add(
          "-tgt_subword_model",
          "--tgt_subword_model",
          help="Path of subword model for tgt.",
      )
  
      # subword regularization(or BPE dropout) options:
      group.add(
          "-src_subword_nbest",
          "--src_subword_nbest",
          type=int,
          default=1,
          help="Number of candidates in subword regularization. "
          "Valid for unigram sampling, "
          "invalid for BPE-dropout. "
          "(source side)",
      )
      group.add(
          "-tgt_subword_nbest",
          "--tgt_subword_nbest",
          type=int,
          default=1,
          help="Number of candidates in subword regularization. "
          "Valid for unigram sampling, "
          "invalid for BPE-dropout. "
          "(target side)",
      )
      group.add(
          "-src_subword_alpha",
          "--src_subword_alpha",
          type=float,
          default=0,
          help="Smoothing parameter for sentencepiece unigram "
          "sampling, and dropout probability for BPE-dropout. "
          "(source side)",
      )
      group.add(
          "-tgt_subword_alpha",
          "--tgt_subword_alpha",
          type=float,
          default=0,
          help="Smoothing parameter for sentencepiece unigram "
          "sampling, and dropout probability for BPE-dropout. "
          "(target side)",
      )
  
      # subword vocabulary restriction options:
      group.add(
          "-src_subword_vocab",
          "--src_subword_vocab",
          type=str,
          default="",
          help="Path to the vocabulary file for src subword. "
          "Format: <word>\t<count> per line.",
      )
      group.add(
          "-tgt_subword_vocab",
          "--tgt_subword_vocab",
          type=str,
          default="",
          help="Path to the vocabulary file for tgt subword. "
          "Format: <word>\t<count> per line.",
      )
      group.add(
          "-src_vocab_threshold",
          "--src_vocab_threshold",
          type=int,
          default=0,
          help="Only produce src subword in src_subword_vocab with "
          " frequency >= src_vocab_threshold.",
      )
      group.add(
          "-tgt_vocab_threshold",
          "--tgt_vocab_threshold",
          type=int,
          default=0,
          help="Only produce tgt subword in tgt_subword_vocab with "
          " frequency >= tgt_vocab_threshold.",
      )
  
imports: import re
  from onmt.utils.logging import logger
  from onmt.transforms import register_transform
  from .transform import Transform, ObservableStats
  from onmt.constants import DefaultTokens
label_desc: Use image node_id 2 for calling the TokenizerTransform obj's underlying member method code with example usage: obj.add_options(cls, parser) without return types