class_docstr: `UnexpecTEDIntentPolicy` has the same model architecture as `TEDPolicy`.
  
  The difference is at a task level.
  Instead of predicting the next probable action, this policy
  predicts whether the last predicted intent is a likely intent
  according to the training stories and conversation context.
class_docstr_tok: ["`","UnexpecTEDIntentPolicy","`","has","the","same","model","architecture","as","`","TEDPolicy","`",".","The","difference","is","at","a","task","level",".","Instead","of","predicting","the","next","probable","action",",","this","policy","predicts","whether","the","last","predicted","intent","is","a","likely","intent","according","to","the","training","stories","and","conversation","context","."]
docstr: Returns the default config (see parent class for full docstring).
docstr_tok: ["Returns","the","default","config","(","see","parent","class","for","full","docstring",")","."]
code: def get_default_config() -> Dict[Text, Any]:
      """Returns the default config (see parent class for full docstring)."""
      return {
          # ## Architecture of the used neural network
          # Hidden layer sizes for layers before the embedding layers for user message
          # and labels.
          # The number of hidden layers is equal to the length
          # of the corresponding list.
          HIDDEN_LAYERS_SIZES: {TEXT: []},
          # Dense dimension to use for sparse features.
          DENSE_DIMENSION: {
              TEXT: 128,
              INTENT: 20,
              ACTION_NAME: 20,
              ENTITIES: 20,
              SLOTS: 20,
              ACTIVE_LOOP: 20,
              f"{LABEL}_{INTENT}": 20,
          },
          # Default dimension to use for concatenating sequence and sentence features.
          CONCAT_DIMENSION: {TEXT: 128},
          # Dimension size of embedding vectors before
          # the dialogue transformer encoder.
          ENCODING_DIMENSION: 50,
          # Number of units in transformer encoders
          TRANSFORMER_SIZE: {TEXT: 128, DIALOGUE: 128},
          # Number of layers in transformer encoders
          NUM_TRANSFORMER_LAYERS: {TEXT: 1, DIALOGUE: 1},
          # Number of attention heads in transformer
          NUM_HEADS: 4,
          # If 'True' use key relative embeddings in attention
          KEY_RELATIVE_ATTENTION: False,
          # If 'True' use value relative embeddings in attention
          VALUE_RELATIVE_ATTENTION: False,
          # Max position for relative embeddings. Only in effect
          # if key- or value relative attention are turned on
          MAX_RELATIVE_POSITION: 5,
          # Use a unidirectional or bidirectional encoder
          # for `text`, `action_text`, and `label_action_text`.
          UNIDIRECTIONAL_ENCODER: False,
          # ## Training parameters
          # Initial and final batch sizes:
          # Batch size will be linearly increased for each epoch.
          BATCH_SIZES: [64, 256],
          # Strategy used when creating batches.
          # Can be either 'sequence' or 'balanced'.
          BATCH_STRATEGY: BALANCED,
          # Number of epochs to train
          EPOCHS: 1,
          # Set random seed to any 'int' to get reproducible results
          RANDOM_SEED: None,
          # Initial learning rate for the optimizer
          LEARNING_RATE: 0.001,
          # ## Parameters for embeddings
          # Dimension size of embedding vectors
          EMBEDDING_DIMENSION: 20,
          # The number of incorrect labels. The algorithm will minimize
          # their similarity to the user input during training.
          NUM_NEG: 20,
          # Number of intents to store in ranking key of predicted action metadata.
          # Set this to `0` to include all intents.
          RANKING_LENGTH: LABEL_RANKING_LENGTH,
          # If 'True' scale loss inverse proportionally to the confidence
          # of the correct prediction
          SCALE_LOSS: True,
          # ## Regularization parameters
          # The scale of regularization
          REGULARIZATION_CONSTANT: 0.001,
          # Dropout rate for embedding layers of dialogue features.
          DROP_RATE_DIALOGUE: 0.1,
          # Dropout rate for embedding layers of utterance level features.
          DROP_RATE: 0.0,
          # Dropout rate for embedding layers of label, e.g. action, features.
          DROP_RATE_LABEL: 0.0,
          # Dropout rate for attention.
          DROP_RATE_ATTENTION: 0.0,
          # Fraction of trainable weights in internal layers.
          CONNECTION_DENSITY: 0.2,
          # If 'True' apply dropout to sparse input tensors
          SPARSE_INPUT_DROPOUT: True,
          # If 'True' apply dropout to dense input tensors
          DENSE_INPUT_DROPOUT: True,
          # If 'True' random tokens of the input message will be masked.
          # Since there is no related loss term used inside TED, the masking
          # effectively becomes just input dropout applied to the text of user
          # utterances.
          MASKED_LM: False,
          # ## Evaluation parameters
          # How often calculate validation accuracy.
          # Small values may hurt performance, e.g. model accuracy.
          EVAL_NUM_EPOCHS: 20,
          # How many examples to use for hold out validation set
          # Large values may hurt performance, e.g. model accuracy.
          EVAL_NUM_EXAMPLES: 0,
          # If you want to use tensorboard to visualize training and validation
          # metrics, set this option to a valid output directory.
          TENSORBOARD_LOG_DIR: None,
          # Define when training metrics for tensorboard should be logged.
          # Either after every epoch or for every training step.
          # Valid values: 'epoch' and 'batch'
          TENSORBOARD_LOG_LEVEL: "epoch",
          # Perform model checkpointing
          CHECKPOINT_MODEL: False,
          # Specify what features to use as sequence and sentence features.
          # By default all features in the pipeline are used.
          FEATURIZERS: [],
          # List of intents to ignore for `action_unlikely_intent` prediction.
          IGNORE_INTENTS_LIST: [],
          # Tolerance for prediction of `action_unlikely_intent`.
          # For each intent, the tolerance is the percentage of
          # negative training instances (trackers for which
          # the corresponding intent is not the correct label) that
          # would be ignored by `UnexpecTEDIntentPolicy`. This is converted
          # into a similarity threshold by identifying the similarity
          # score for the (1 - tolerance) percentile of negative
          # examples. Any tracker with a similarity score below this
          # threshold will trigger an `action_unlikely_intent`.
          # Higher values of `tolerance` means the policy is more
          # "tolerant" to surprising paths in conversations and
          # hence will result in lesser number of `action_unlikely_intent`
          # triggers. Acceptable values are between 0.0 and 1.0 (inclusive).
          TOLERANCE: 0.0,
          # Split entities by comma, this makes sense e.g. for a list of
          # ingredients in a recipe, but it doesn't make sense for the parts of
          # an address
          SPLIT_ENTITIES_BY_COMMA: SPLIT_ENTITIES_BY_COMMA_DEFAULT_VALUE,
          # Type of similarity measure to use, either 'auto' or 'cosine' or 'inner'.
          SIMILARITY_TYPE: INNER,
          # If set to true, entities are predicted in user utterances.
          ENTITY_RECOGNITION: False,
          # 'BILOU_flag' determines whether to use BILOU tagging or not.
          # If set to 'True' labelling is more rigorous, however more
          # examples per entity are required.
          # Rule of thumb: you should have more than 100 examples per entity.
          BILOU_FLAG: False,
          # The type of the loss function, either 'cross_entropy' or 'margin'.
          LOSS_TYPE: CROSS_ENTROPY,
          # Determines the importance of policies, higher values take precedence
          POLICY_PRIORITY: UNLIKELY_INTENT_POLICY_PRIORITY,
          USE_GPU: True,
      }
  
imports: import dataclasses
  import logging
  from pathlib import Path
  from typing import Any, List, Optional, Text, Dict, Type, Union
  import numpy
  import tensorflow
  import rasa.utils.common
  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.nlu.classifiers import LABEL_RANKING_LENGTH
  from rasa.shared.nlu.training_data.features import Features
  from rasa.shared.core.domain import Domain
  from rasa.shared.core.trackers import DialogueStateTracker
  from rasa.shared.core.constants import SLOTS, ACTIVE_LOOP, ACTION_UNLIKELY_INTENT_NAME
  from rasa.shared.core.events import UserUttered, ActionExecuted
  from rasa.shared.nlu.constants import INTENT, TEXT, ENTITIES, ACTION_NAME, SPLIT_ENTITIES_BY_COMMA, SPLIT_ENTITIES_BY_COMMA_DEFAULT_VALUE
  from rasa.nlu.extractors.extractor import EntityTagSpec
  from rasa.core.featurizers.precomputation import MessageContainerForCoreFeaturization
  from rasa.core.featurizers.tracker_featurizers import TrackerFeaturizer
  from rasa.core.featurizers.tracker_featurizers import IntentMaxHistoryTrackerFeaturizer
  from rasa.core.featurizers.single_state_featurizer import IntentTokenizerSingleStateFeaturizer
  from rasa.shared.core.generator import TrackerWithCachedStates
  from rasa.core.constants import DIALOGUE, POLICY_MAX_HISTORY, POLICY_PRIORITY, UNLIKELY_INTENT_POLICY_PRIORITY
  from rasa.core.policies.policy import PolicyPrediction
  from rasa.core.policies.ted_policy import LABEL_KEY, LABEL_SUB_KEY, TEDPolicy, TED, SEQUENCE_LENGTH, SEQUENCE, PREDICTION_FEATURES
  from rasa.utils import train_utils
  from rasa.utils.tensorflow.models import RasaModel
  from rasa.utils.tensorflow.constants import LABEL, DENSE_DIMENSION, ENCODING_DIMENSION, UNIDIRECTIONAL_ENCODER, TRANSFORMER_SIZE, NUM_TRANSFORMER_LAYERS, NUM_HEADS, BATCH_SIZES, BATCH_STRATEGY, EPOCHS, RANDOM_SEED, RANKING_LENGTH, LOSS_TYPE, SIMILARITY_TYPE, NUM_NEG, EVAL_NUM_EXAMPLES, EVAL_NUM_EPOCHS, REGULARIZATION_CONSTANT, SCALE_LOSS, EMBEDDING_DIMENSION, DROP_RATE_DIALOGUE, DROP_RATE_LABEL, DROP_RATE, DROP_RATE_ATTENTION, CONNECTION_DENSITY, KEY_RELATIVE_ATTENTION, VALUE_RELATIVE_ATTENTION, MAX_RELATIVE_POSITION, INNER, BALANCED, TENSORBOARD_LOG_DIR, TENSORBOARD_LOG_LEVEL, CHECKPOINT_MODEL, FEATURIZERS, ENTITY_RECOGNITION, IGNORE_INTENTS_LIST, BILOU_FLAG, LEARNING_RATE, CROSS_ENTROPY, SPARSE_INPUT_DROPOUT, DENSE_INPUT_DROPOUT, MASKED_LM, HIDDEN_LAYERS_SIZES, CONCAT_DIMENSION, TOLERANCE, LABEL_PAD_ID, POSITIVE_SCORES_KEY, NEGATIVE_SCORES_KEY, USE_GPU
  from rasa.utils.tensorflow import layers
  from rasa.utils.tensorflow.model_data import RasaModelData, FeatureArray, Data
  import rasa.utils.io
  from rasa.core.exceptions import RasaCoreException
  from rasa.shared.utils import common
label_desc: Use image node_id 1 for calling the UnexpecTEDIntentPolicy obj's underlying member method code with example usage: obj.get_default_config() and returns: dict