code: def build_argparse():
      """
      If args == None, the system args are used.
      """
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "--txt_file", type=str, help="Input plaintext file"
      )
      parser.add_argument(
          "--label_file",
          type=str,
          default=None,
          help="Character-level label file",
      )
      parser.add_argument(
          "--mwt_json_file",
          type=str,
          default=None,
          help="JSON file for MWT expansions",
      )
      parser.add_argument(
          "--conll_file",
          type=str,
          default=None,
          help="CoNLL file for output",
      )
      parser.add_argument(
          "--dev_txt_file",
          type=str,
          help="(Train only) Input plaintext file for the dev set",
      )
      parser.add_argument(
          "--dev_label_file",
          type=str,
          default=None,
          help="(Train only) Character-level label file for the dev set",
      )
      parser.add_argument(
          "--dev_conll_gold",
          type=str,
          default=None,
          help="(Train only) CoNLL-U file for the dev set for early stopping",
      )
      parser.add_argument("--lang", type=str, help="Language")
      parser.add_argument(
          "--shorthand", type=str, help="UD treebank shorthand"
      )
  
      parser.add_argument(
          "--mode", default="train", choices=["train", "predict"]
      )
      parser.add_argument(
          "--skip_newline",
          action="store_true",
          help="Whether to skip newline characters in input. Particularly useful for languages like Chinese.",
      )
  
      parser.add_argument(
          "--emb_dim",
          type=int,
          default=32,
          help="Dimension of unit embeddings",
      )
      parser.add_argument(
          "--hidden_dim",
          type=int,
          default=64,
          help="Dimension of hidden units",
      )
      parser.add_argument(
          "--conv_filters",
          type=str,
          default="1,9",
          help="Configuration of conv filters. ,, separates layers and , separates filter sizes in the same layer.",
      )
      parser.add_argument(
          "--no-residual",
          dest="residual",
          action="store_false",
          help="Add linear residual connections",
      )
      parser.add_argument(
          "--no-hierarchical",
          dest="hierarchical",
          action="store_false",
          help='"Hierarchical" RNN tokenizer',
      )
      parser.add_argument(
          "--hier_invtemp",
          type=float,
          default=0.5,
          help="Inverse temperature used in propagating tokenization predictions between RNN layers",
      )
      parser.add_argument(
          "--input_dropout",
          action="store_true",
          help="Dropout input embeddings as well",
      )
      parser.add_argument(
          "--conv_res",
          type=str,
          default=None,
          help="Convolutional residual layers for the RNN",
      )
      parser.add_argument(
          "--rnn_layers",
          type=int,
          default=1,
          help="Layers of RNN in the tokenizer",
      )
      parser.add_argument(
          "--use_dictionary",
          action="store_true",
          help="Use dictionary feature. The lexicon is created using the training data and external dict (if any) expected to be found under the same folder of training dataset, formatted as SHORTHAND-externaldict.txt where each line in this file is a word. For example, data/tokenize/zh_gsdsimp-externaldict.txt",
      )
  
      parser.add_argument(
          "--max_grad_norm",
          type=float,
          default=1.0,
          help="Maximum gradient norm to clip to",
      )
      parser.add_argument(
          "--anneal",
          type=float,
          default=0.999,
          help="Anneal the learning rate by this amount when dev performance deteriorate",
      )
      parser.add_argument(
          "--anneal_after",
          type=int,
          default=2000,
          help="Anneal the learning rate no earlier than this step",
      )
      parser.add_argument(
          "--lr0",
          type=float,
          default=2e-3,
          help="Initial learning rate",
      )
      parser.add_argument(
          "--dropout",
          type=float,
          default=0.33,
          help="Dropout probability",
      )
      parser.add_argument(
          "--unit_dropout",
          type=float,
          default=0.33,
          help="Unit dropout probability",
      )
      parser.add_argument(
          "--feat_dropout",
          type=float,
          default=0.05,
          help="Features dropout probability for each element in feature vector",
      )
      parser.add_argument(
          "--feat_unit_dropout",
          type=float,
          default=0.33,
          help="The whole feature of units dropout probability",
      )
      parser.add_argument(
          "--tok_noise",
          type=float,
          default=0.02,
          help="Probability to induce noise to the input of the higher RNN",
      )
      parser.add_argument(
          "--sent_drop_prob",
          type=float,
          default=0.2,
          help="Probability to drop sentences at the end of batches during training uniformly at random.  Idea is to fake paragraph endings.",
      )
      parser.add_argument(
          "--weight_decay", type=float, default=0.0, help="Weight decay"
      )
      parser.add_argument(
          "--max_seqlen",
          type=int,
          default=100,
          help="Maximum sequence length to consider at a time",
      )
      parser.add_argument(
          "--batch_size", type=int, default=32, help="Batch size to use"
      )
      parser.add_argument(
          "--epochs",
          type=int,
          default=10,
          help="Total epochs to train the model for",
      )
      parser.add_argument(
          "--steps",
          type=int,
          default=50000,
          help="Steps to train the model for, if unspecified use epochs",
      )
      parser.add_argument(
          "--report_steps",
          type=int,
          default=20,
          help="Update step interval to report loss",
      )
      parser.add_argument(
          "--shuffle_steps",
          type=int,
          default=100,
          help="Step interval to shuffle each paragraph in the generator",
      )
      parser.add_argument(
          "--eval_steps",
          type=int,
          default=200,
          help="Step interval to evaluate the model on the dev set for early stopping",
      )
      parser.add_argument(
          "--max_steps_before_stop",
          type=int,
          default=5000,
          help="Early terminates after this many steps if the dev scores are not improving",
      )
      parser.add_argument(
          "--save_name",
          type=str,
          default=None,
          help="File name to save the model",
      )
      parser.add_argument(
          "--load_name",
          type=str,
          default=None,
          help="File name to load a saved model",
      )
      parser.add_argument(
          "--save_dir",
          type=str,
          default="saved_models/tokenize",
          help="Directory to save models in",
      )
      utils.add_device_args(parser)
      parser.add_argument("--seed", type=int, default=1234)
  
      parser.add_argument(
          "--use_mwt",
          dest="use_mwt",
          default=None,
          action="store_true",
          help="Whether or not to include mwt output layers.  If set to None, this will be determined by examining the training data for MWTs",
      )
      parser.add_argument(
          "--no_use_mwt",
          dest="use_mwt",
          action="store_false",
          help="Whether or not to include mwt output layers",
      )
  
      parser.add_argument(
          "--wandb",
          action="store_true",
          help="Start a wandb session and write the results of training.  Only applies to training.  Use --wandb_name instead to specify a name",
      )
      parser.add_argument(
          "--wandb_name",
          default=None,
          help="Name of a wandb session to start when training.  Will default to the dataset short name",
      )
      return parser
  
file_path: stanza/stanza/models/tokenizer.py
imports: import argparse
  from copy import copy
  import logging
  import random
  import numpy
  import os
  import torch
  import json
  from stanza.models.common import utils
  from stanza.models.tokenization.trainer import Trainer
  from stanza.models.tokenization.data import DataLoader, TokenizationDataset
  from stanza.models.tokenization.utils import load_mwt_dict, eval_model, output_predictions, load_lexicon, create_dictionary
  from stanza.models import _training_logging
label_desc: Use image node_id 1 for calling a global function with example usage: build_argparse() and returns: parser