class_docstr: A regular expression-based tokenizer at word boundary.
  This tokenizer default to support MegaMolBART.
  <https://catalog.ngc.nvidia.com/orgs/nvidia/teams/clara/models/megamolbart>
docstr: Loads tokenizer's regex and vocab files
docstr_tok: ["Loads","tokenizer","'s","regex","and","vocab","files"]
code: def load_tokenizer(self, regex_file=None, vocab_file=None):
      """
      Loads tokenizer's regex and vocab files
      """
      regex_file, vocab_file = self._get_regex_vocab_files(
          regex_file=regex_file, vocab_file=vocab_file
      )
  
      # load vocab file
      # vocab_file: path to file with vocabulary which consists
      # of characters separated by \n (None/"" for empty vocab)
  
      logging.info(f"Loading vocabulary from file = {vocab_file}")
      if os.path.exists(vocab_file):
          vocab = {}
          with open(vocab_file, "r") as f:
              for line in f:
                  line = line.strip()
                  if line:
                      vocab[line] = len(vocab)
          self.vocab = vocab
      else:
          raise RuntimeError(f"Missing vocab_file = {vocab_file}")
  
      # load regex from a file
      if os.path.exists(regex_file):
          logging.info(f"Loading regex from file = {regex_file}")
          self.regex = open(regex_file, encoding="utf-8").read().strip()
      else:
          raise RuntimeError(f"Missing regex_file = {regex_file}")
  
      self._update_cache()
      self._compile_regex()
  
      return self
  
imports: import os
  import re
  from typing import Optional
  import pandas
  from nemo.collections.common.tokenizers.char_tokenizer import TokenizerSpec
  from nemo.utils import logging
label_desc: Use image node_id 20 for calling the RegExTokenizer obj's underlying member method code with example usage: obj.load_tokenizer(regex_file, vocab_file) and returns: self