class_docstr: Response selector using supervised embeddings.
  
  The response selector embeds user inputs
  and candidate response into the same space.
  Supervised embeddings are trained by maximizing similarity between them.
  It also provides rankings of the response that did not "win".
  
  The supervised response selector needs to be preceded by
  a featurizer in the pipeline.
  This featurizer creates the features used for the embeddings.
  It is recommended to use ``CountVectorsFeaturizer`` that
  can be optionally preceded by ``SpacyNLP`` and ``SpacyTokenizer``.
  
  Based on the starspace idea from: https://arxiv.org/abs/1709.03856.
  However, in this implementation the `mu` parameter is treated differently
  and additional hidden layers are added together with dropout.
class_docstr_tok: ["Response","selector","using","supervised","embeddings",".","The","response","selector","embeds","user","inputs","and","candidate","response","into","the","same","space",".","Supervised","embeddings","are","trained","by","maximizing","similarity","between","them",".","It","also","provides","rankings","of","the","response","that","did","not","``","win","''",".","The","supervised","response","selector","needs","to","be","preceded","by","a","featurizer","in","the","pipeline",".","This","featurizer","creates","the","features","used","for","the","embeddings",".","It","is","recommended","to","use","``","CountVectorsFeaturizer","``","that","can","be","optionally","preceded","by","``","SpacyNLP","``","and","``","SpacyTokenizer","``",".","Based","on","the","starspace","idea","from",":","https",":","\/\/arxiv.org\/abs\/1709.03856",".","However",",","in","this","implementation","the","`","mu","`","parameter","is","treated","differently","and","additional","hidden","layers","are","added","together","with","dropout","."]
code: def _load_model_class(
      cls,
      tf_model_file: Text,
      model_data_example: RasaModelData,
      label_data: RasaModelData,
      entity_tag_specs: List[EntityTagSpec],
      config: Dict[Text, Any],
      finetune_mode: bool = False,
  ) -> "RasaModel":
      predict_data_example = RasaModelData(
          label_key=model_data_example.label_key,
          data={
              feature_name: features
              for feature_name, features in model_data_example.items()
              if TEXT in feature_name
          },
      )
      return cls.model_class(config[USE_TEXT_AS_LABEL]).load(
          tf_model_file,
          model_data_example,
          predict_data_example,
          data_signature=model_data_example.get_signature(),
          label_data=label_data,
          entity_tag_specs=entity_tag_specs,
          config=copy.deepcopy(config),
          finetune_mode=finetune_mode,
      )
  
imports: from __future__ import annotations
  import copy
  import logging
  from rasa.nlu.featurizers.featurizer import Featurizer
  import numpy
  import tensorflow
  from typing import Any, Dict, Optional, Text, Tuple, Union, List, Type
  from rasa.engine.graph import ExecutionContext
  from rasa.engine.recipes.default_recipe import DefaultV1Recipe
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
  from rasa.shared.constants import DIAGNOSTIC_DATA
  from rasa.shared.nlu.training_data import util
  import rasa.shared.utils.io
  from rasa.shared.exceptions import InvalidConfigException
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
  from rasa.nlu.classifiers.diet_classifier import DIET, LABEL_KEY, LABEL_SUB_KEY, SENTENCE, SEQUENCE, DIETClassifier
  from rasa.nlu.extractors.extractor import EntityTagSpec
  from rasa.utils.tensorflow import rasa_layers
  from rasa.utils.tensorflow.constants import LABEL, HIDDEN_LAYERS_SIZES, SHARE_HIDDEN_LAYERS, TRANSFORMER_SIZE, NUM_TRANSFORMER_LAYERS, NUM_HEADS, BATCH_SIZES, BATCH_STRATEGY, EPOCHS, RANDOM_SEED, LEARNING_RATE, RANKING_LENGTH, RENORMALIZE_CONFIDENCES, LOSS_TYPE, SIMILARITY_TYPE, NUM_NEG, SPARSE_INPUT_DROPOUT, DENSE_INPUT_DROPOUT, MASKED_LM, ENTITY_RECOGNITION, INTENT_CLASSIFICATION, EVAL_NUM_EXAMPLES, EVAL_NUM_EPOCHS, UNIDIRECTIONAL_ENCODER, DROP_RATE, DROP_RATE_ATTENTION, CONNECTION_DENSITY, NEGATIVE_MARGIN_SCALE, REGULARIZATION_CONSTANT, SCALE_LOSS, USE_MAX_NEG_SIM, MAX_NEG_SIM, MAX_POS_SIM, EMBEDDING_DIMENSION, BILOU_FLAG, KEY_RELATIVE_ATTENTION, VALUE_RELATIVE_ATTENTION, MAX_RELATIVE_POSITION, RETRIEVAL_INTENT, USE_TEXT_AS_LABEL, CROSS_ENTROPY, AUTO, BALANCED, TENSORBOARD_LOG_DIR, TENSORBOARD_LOG_LEVEL, CONCAT_DIMENSION, FEATURIZERS, CHECKPOINT_MODEL, DENSE_DIMENSION, CONSTRAIN_SIMILARITIES, MODEL_CONFIDENCE, SOFTMAX
  from rasa.nlu.constants import RESPONSE_SELECTOR_PROPERTY_NAME, RESPONSE_SELECTOR_RETRIEVAL_INTENTS, RESPONSE_SELECTOR_RESPONSES_KEY, RESPONSE_SELECTOR_PREDICTION_KEY, RESPONSE_SELECTOR_RANKING_KEY, RESPONSE_SELECTOR_UTTER_ACTION_KEY, RESPONSE_SELECTOR_DEFAULT_INTENT, DEFAULT_TRANSFORMER_SIZE
  from rasa.shared.nlu.constants import TEXT, INTENT, RESPONSE, INTENT_RESPONSE_KEY, INTENT_NAME_KEY, PREDICTED_CONFIDENCE_KEY
  from rasa.utils.tensorflow.model_data import RasaModelData
  from rasa.utils.tensorflow.models import RasaModel
label_desc: Use image node_id 17 for calling the ResponseSelector obj's underlying member method code with example usage: obj._load_model_class(cls, tf_model_file, model_data_example, label_data, entity_tag_specs, config, finetune_mode) and returns: cls