class_docstr: Base Preparer class for nlp
class_docstr_tok: ["Base","Preparer","class","for","nlp"]
docstr: Run the text pre-process pipeline, fetch data in numpy array format.
docstr_tok: ["Run","the","text","pre-process","pipeline",",","fetch","data","in","numpy","array","format","."]
code: def run_dataset(self, data_iterator, batch_num):
      """Run the text pre-process pipeline, fetch data in numpy array format."""
      data_after = []
      data_t = data_iterator.get_next()
      with tf.Session(config=self.session_conf) as sess:
          sess.run(
              data_iterator.initializer, feed_dict=self.init_feed_dict
          )
          for _ in range(batch_num):
              try:
                  data_after.append(sess.run(data_t))
              except tf.errors.OutOfRangeError:
                  break
      data_after_arr = np.concatenate(data_after, axis=0)
      return data_after_arr
  
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 4 for calling the TextPreparer obj's underlying member method code with example usage: obj.run_dataset(data_iterator, batch_num) and returns: data_after_arr