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: Learns vocabulary from a CSV file. Can be called multiple times to update vocabulary.
docstr_tok: ["Learns","vocabulary","from","a","CSV","file",".","Can","be","called","multiple","times","to","update","vocabulary","."]
code: def build_vocab_from_csv(self, data_csv_file, col="smiles"):
      """
      Learns vocabulary from a CSV file. Can be called multiple times to update vocabulary.
      """
      logging.debug(
          f"Building vocabulary from CSV col = {col} file = {data_csv_file}"
      )
  
      # NOTE this has to be run on each CSV file
      if not os.path.exists(data_csv_file):
          raise ValueError(f"Data file: {data_csv_file} is missing")
  
      df = pd.read_csv(data_csv_file)
  
      vocab = self.vocab
      for d in df[col]:
          tokens = self.text_to_tokens(d)
          logging.debug(f"Text: {d}, Tokens: {tokens}")
          for token in tokens:
              if token not in vocab:
                  vocab[token] = len(vocab)
  
      sorted_vocab = sorted(vocab.items(), key=lambda k_v: k_v[1])
      logging.debug(f"Vocab: {sorted_vocab}")
  
      self.vocab = vocab
      self._update_cache()
  
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 21 for calling the RegExTokenizer obj's underlying member method code with example usage: obj.build_vocab_from_csv(data_csv_file, col) without return types