(self, data_iterator, batch_num)
return data_after_arr
Run the text pre-process pipeline, fetch data in numpy array format.
Run the text pre-process pipeline, fetch data in numpy array format.
Run the text pre - process pipeline fetch data in numpy array format .
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
def run_dataset ( self , data_iterator , batch_num ) : 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