class_docstr: Base Preparer class for nlp
class_docstr_tok: ["Base","Preparer","class","for","nlp"]
docstr: Preparing text vocab
docstr_tok: ["Preparing","text","vocab"]
code: def prepare_text_vocab(self, all_texts):
      """Preparing text vocab"""
      if (
          os.path.exists(self.text_vocab_file_path)
          and self.use_custom_vocab
      ):
          logging.info(
              "Reuse text vocab file: {}".format(
                  self.text_vocab_file_path
              )
          )
      else:
          prepare_vocab(
              self.text_vocab_file_path,
              all_texts,
              min_frequency=self.vocab_min_frequency,
          )
          logging.info(
              "Generate text vocab file: {}".format(
                  self.text_vocab_file_path
              )
          )
  
imports: import os
  import math
  from pathlib import Path
  from absl import logging
  import delta.compat
  import numpy
  from delta import utils
  from delta.data.preprocess.utils import prepare_embedding
  from delta.utils.solver.utils.solver_utils import get_session_conf
  from delta.data.preprocess.utils import prepare_vocab
  from delta.data.preprocess.utils import prepare_vocab_from_config
  from delta.data.preprocess.utils import get_pre_process_text_ds_iter
  from delta.data.utils.common_utils import get_file_len
label_desc: Use image node_id 8 for calling the TextPreparer obj's underlying member method code with example usage: obj.prepare_text_vocab(all_texts) without return types