class_docstr: sequence labeling task test
docstr: test seq label task of english data 
docstr_tok: ["test","seq","label","task","of","english","data"]
code: def test_english(self):
      """test seq label task of english data"""
      config = utils.load_config(self.config_file)
      max_len = config["model"]["net"]["structure"]["max_len"]
      config["data"]["task"]["language"] = "english"
      task_config = config["data"]["task"]
      task_config[
          "text_vocab"
      ] = "egs/mock_text_seq_label_data/seq-label/v1/data/text_vocab.txt"
      task_config["need_shuffle"] = False
  
      task = TextSeqLabelTask(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])
          self.assertAllEqual(res[0][0][:5], [2, 3, 4, 5, 0])
          self.assertEqual(np.shape(res[0]), (10, max_len))
          self.assertEqual(np.shape(res[1]), (10, max_len))
  
      # 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:
          sess.run(data["iterator"].initializer)
          res = sess.run(
              input_x, feed_dict={input_sentence: ["I feel good ."]}
          )
          logging.debug(res[0][:5])
          self.assertAllEqual(res[0][:5], [0, 3, 4, 5, 0])
          self.assertEqual(np.shape(res[0]), (max_len,))
  
file_path: delta/delta/data/task/text_seq_label_task_test.py
imports: import os
  from pathlib import Path
  import numpy
  import delta.compat
  from absl import logging
  from delta import utils
  from delta.data.task.text_seq_label_task import TextSeqLabelTask
  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 TextSeqLabelTaskTest obj's underlying member method code with example usage: obj.test_english() without return types