code: def test_label_processor(self):
      x_set, y_set = TestMacros.load_labeling_corpus()
      text_processor = SequenceProcessor(
          build_vocab_from_labels=True, min_count=1
      )
      text_processor.build_vocab(x_set, y_set)
  
      samples = random.sample(y_set, 20)
  
      text_idx = text_processor.transform(samples)
  
      text_info_dict = text_processor.to_dict()
  
      text_processor2: SequenceProcessor = load_data_object(
          text_info_dict
      )
  
      text_idx2 = text_processor2.transform(samples)
      lengths = [len(i) for i in samples]
      assert (text_idx2 == text_idx).all()
      assert (
          text_processor2.inverse_transform(text_idx, lengths=lengths)
          == samples
      )
      assert (
          text_processor2.inverse_transform(text_idx2, lengths=lengths)
          == samples
      )
  
      text_idx3 = text_processor.transform(samples, seq_length=20)
      assert [len(i) for i in text_idx3] == [20] * len(text_idx3)
  
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 2 for calling the TestSequenceProcessor obj's underlying member method code with example usage: obj.test_label_processor() without return types