class_docstr: Adds message features based on regex expressions.
class_docstr_tok: ["Adds","message","features","based","on","regex","expressions","."]
docstr: Loads trained component (see parent class for full docstring).
docstr_tok: ["Loads","trained","component","(","see","parent","class","for","full","docstring",")","."]
code: def load(
      cls,
      config: Dict[Text, Any],
      model_storage: ModelStorage,
      resource: Resource,
      execution_context: ExecutionContext,
      **kwargs: Any,
  ) -> RegexFeaturizer:
      """Loads trained component (see parent class for full docstring)."""
      known_patterns = None
  
      try:
          with model_storage.read_from(resource) as model_dir:
              patterns_file_name = model_dir / "patterns.pkl"
              known_patterns = rasa.shared.utils.io.read_json_file(
                  patterns_file_name
              )
      except (ValueError, FileNotFoundError):
          logger.warning(
              f"Failed to load `{cls.__class__.__name__}` from model storage. "
              f"Resource '{resource.name}' doesn't exist."
          )
  
      return cls(
          config,
          model_storage,
          resource,
          execution_context,
          known_patterns=known_patterns,
      )
  
imports: from __future__ import annotations
  import logging
  import re
  from typing import Any, Dict, List, Optional, Text, Tuple, Type
  import numpy
  import scipy.sparse
  from rasa.nlu.tokenizers.tokenizer import Tokenizer
  import rasa.shared.utils.io
  import rasa.utils.io
  import rasa.nlu.utils.pattern_utils
  from rasa.engine.graph import ExecutionContext, GraphComponent
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.nlu.constants import TOKENS_NAMES
  from rasa.nlu.featurizers.sparse_featurizer.sparse_featurizer import SparseFeaturizer
  from rasa.shared.nlu.constants import TEXT, RESPONSE, ACTION_TEXT
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
label_desc: Use image node_id 11 for calling the RegexFeaturizer obj's underlying member method code with example usage: obj.load(cls, config, model_storage, resource, execution_context) and returns: cls