code: def test_text_processor(self):
      x_set, y_set = TestMacros.load_labeling_corpus()
      x_samples = random.sample(x_set, 5)
      text_processor = SequenceProcessor(min_count=1)
      text_processor.build_vocab(x_set, y_set)
      text_idx = text_processor.transform(x_samples)
  
      text_info_dict = text_processor.to_dict()
      text_processor2: SequenceProcessor = load_data_object(
          text_info_dict
      )
  
      text_idx2 = text_processor2.transform(x_samples)
      sample_lengths = [len(i) for i in x_samples]
  
      assert (text_idx2 == text_idx).all()
      assert (
          text_processor.inverse_transform(
              text_idx, lengths=sample_lengths
          )
          == x_samples
      )
      assert (
          text_processor2.inverse_transform(
              text_idx2, lengths=sample_lengths
          )
          == x_samples
      )
  
file_path: Kashgari/tests/test_processor/test_sequence_processor.py
imports: import random
  import unittest
  from tests.test_macros import TestMacros
  from kashgari.utils import load_data_object
  from kashgari.processors import SequenceProcessor
label_desc: Use image node_id 1 for calling the TestSequenceProcessor obj's underlying member method code with example usage: obj.test_text_processor() without return types