code: def test_english(self):
      config = utils.load_config(self.config_file)
      class_num = config["data"]["task"]["classes"]["num_classes"]
      task_config = config["data"]["task"]
      task_config["language"] = "english"
      task_config["split_by_space"] = True
      task_config["clean_english"] = True
      data_config = config["data"]
      data_config["train"]["paths"] = [
          "egs/mock_text_cls_data/text_cls/v1/data/train.english.txt"
      ]
      data_config["eval"]["paths"] = [
          "egs/mock_text_cls_data/text_cls/v1/data/eval.english.txt"
      ]
      data_config["infer"]["paths"] = [
          "egs/mock_text_cls_data/text_cls/v1/data/test.english.txt"
      ]
      task_config[
          "text_vocab"
      ] = "egs/mock_text_cls_data/text_cls/v1/data/text_vocab.english.txt"
      task_config["need_shuffle"] = False
      config["model"]["split_token"] = ""
      task_config["preparer"]["reuse"] = False
  
      task = TextClsTask(config, utils.TRAIN)
  
      # test offline data
      data = task.dataset()
      self.assertTrue(
          "input_x_dict" in data and "input_x" in data["input_x_dict"]
      )
      self.assertTrue(
          "input_y_dict" in data and "input_y" in data["input_y_dict"]
      )
      with self.cached_session(use_gpu=False, force_gpu=False) as sess:
          sess.run(data["iterator"].initializer)
          res = sess.run(
              [
                  data["input_x_dict"]["input_x"],
                  data["input_y_dict"]["input_y"],
              ]
          )
          logging.debug(res[0][0][:5])
          logging.debug(res[1][0][:5])
          self.assertAllEqual(res[0][0][:5], [3, 4, 5, 0, 0])
          self.assertEqual(np.shape(res[1]), (32, class_num))
  
      # test online data
      export_inputs = task.export_inputs()
      self.assertTrue(
          "export_inputs" in export_inputs
          and "input_sentence" in export_inputs["export_inputs"]
      )
      input_sentence = export_inputs["export_inputs"]["input_sentence"]
      input_x = export_inputs["model_inputs"]["input_x"]
      with self.cached_session(use_gpu=False, force_gpu=False) as sess:
          res = sess.run(
              input_x, feed_dict={input_sentence: ["All is well."]}
          )
          logging.debug(res[0][:5])
          self.assertAllEqual(res[0][:5], [3, 4, 5, 0, 0])
  
file_path: delta/delta/data/task/text_cls_task_test.py
imports: import os
  from pathlib import Path
  from absl import logging
  import numpy
  import delta.compat
  from delta import utils
  from delta.data.task.text_cls_task import TextClsTask
  from delta.utils.register import import_all_modules_for_register
  from delta import PACKAGE_ROOT_DIR
label_desc: Use image node_id 3 for calling the TextClsTaskTest obj's underlying member method code with example usage: obj.test_english() without return types