code: def test_should_be_serializable(self):
      # Given
      dataset_stream = io.StringIO(
          """
  ---
  type: intent
  name: my_intent
  utterances:
  - this is [slot1:entity1](my first entity)
  - this is [slot2:entity2](second_entity)"""
      )
      dataset = Dataset.from_yaml_files("en", [dataset_stream]).json
      features_factories = [
          {
              "factory_name": ShapeNgramFactory.name,
              "args": {"n": 1},
              "offsets": [0],
          },
          {
              "factory_name": IsDigitFactory.name,
              "args": {},
              "offsets": [-1, 0],
          },
      ]
      config = CRFSlotFillerConfig(
          tagging_scheme=TaggingScheme.BILOU,
          feature_factory_configs=features_factories,
      )
      shared = self.get_shared_data(dataset)
      slot_filler = CRFSlotFiller(config, **shared)
      intent = "my_intent"
      slot_filler.fit(dataset, intent=intent)
  
      # When
      slot_filler.persist(self.tmp_file_path)
  
      # Then
      metadata_path = self.tmp_file_path / "metadata.json"
      self.assertJsonContent(
          metadata_path, {"unit_name": "crf_slot_filler"}
      )
  
      self.assertTrue(
          (self.tmp_file_path / CRF_MODEL_FILENAME).exists()
      )
  
      expected_feature_factories = [
          {
              "factory_name": ShapeNgramFactory.name,
              "args": {"n": 1, "language_code": "en"},
              "offsets": [0],
          },
          {
              "factory_name": IsDigitFactory.name,
              "args": {},
              "offsets": [-1, 0],
          },
      ]
      expected_config = CRFSlotFillerConfig(
          tagging_scheme=TaggingScheme.BILOU,
          feature_factory_configs=expected_feature_factories,
      )
      expected_slot_filler_dict = {
          "crf_model_file": CRF_MODEL_FILENAME,
          "language_code": "en",
          "config": expected_config.to_dict(),
          "intent": intent,
          "slot_name_mapping": {
              "slot1": "entity1",
              "slot2": "entity2",
          },
      }
      slot_filler_path = self.tmp_file_path / "slot_filler.json"
      self.assertJsonContent(
          slot_filler_path, expected_slot_filler_dict
      )
  
imports: from __future__ import unicode_literals
  import io
  import os
  from builtins import range
  from pathlib import Path
  from unittest import skipIf
  from mock import MagicMock, PropertyMock
  from sklearn_crfsuite import CRF
  from snips_nlu.constants import DATA, END, ENTITY, LANGUAGE_EN, SLOT_NAME, START, TEXT, RANDOM_STATE
  from snips_nlu.dataset import Dataset
  from snips_nlu.entity_parser import CustomEntityParserUsage
  from snips_nlu.exceptions import NotTrained
  from snips_nlu.pipeline.configs import CRFSlotFillerConfig
  from snips_nlu.preprocessing import tokenize, Token
  from snips_nlu.result import unresolved_slot
  from snips_nlu.slot_filler.crf_slot_filler import CRFSlotFiller, _ensure_safe, _encode_tag, CRF_MODEL_FILENAME
  from snips_nlu.slot_filler.crf_utils import TaggingScheme
  from snips_nlu.slot_filler.feature_factory import IsDigitFactory, NgramFactory, ShapeNgramFactory
  from snips_nlu.tests.utils import FixtureTest, TEST_PATH
label_desc: Use image node_id 16 for calling the TestCRFSlotFiller obj's underlying member method code with example usage: obj.test_should_be_serializable() without return types