code: def test_transformer(self):
      d = {
          "col1": [
              "This is the first document.",
              "This document is the second document.",
              "And this is the third one.",
              None,
              "Is this the first document?",
          ]
      }
      df = pd.DataFrame(data=d)
      df_org = df.copy()
  
      transf = TextTransformer()
      transf.fit(df, "col1")
      df = transf.transform(df)
      self.assertTrue(df.shape[0] == 5)
      self.assertTrue("col1" not in df.columns)
  
      transf2 = TextTransformer()
      transf2.from_json(transf.to_json())
      df2 = transf2.transform(df_org)
      self.assertTrue("col1" not in df2.columns)
  
      assert_almost_equal(df.iloc[0, 0], df2.iloc[0, 0])
  
file_path: mljar-supervised/tests/tests_preprocessing/test_text_transformer.py
imports: import unittest
  import tempfile
  import json
  import numpy
  import pandas
  from numpy.testing import assert_almost_equal
  from supervised.preprocessing.text_transformer import TextTransformer
label_desc: Use image node_id 1 for calling the TextTransformerTest obj's underlying member method code with example usage: obj.test_transformer() without return types