This is documentation for Rasa & Rasa Pro Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).
Transformer Embedding Dialogue (TED) Policy.
The model architecture is described in detail in https://arxiv.org/abs/1910.00486. In summary, the architecture comprises of the following steps:
Declares instance variables with default values.
Gets the class of the model architecture to be used by the policy.
Feeds the featurized training data to the model.
model_data- Featurized training data.
label_ids- Label ids corresponding to the data points in
model_data. These may or may not be used by the function depending on how the policy is trained.
Trains the policy on given training trackers.
training_trackers- List of training trackers to be used for training the model.
domain- Domain of the assistant.
interpreter- NLU Interpreter to be used for featurizing the states.
**kwargs- Any other argument.
Predicts the next action the bot should take after seeing the tracker.
tracker- the :class:
domain- the :class:
interpreter- Interpreter which may be used by the policies to create additional features.
The policy's prediction (e.g. the probabilities for the actions).
Persists the policy to a storage.
Persists model's utility attributes like model weights, etc.
model_path- Path where model is to be persisted
Loads a policy from the storage.
path- Path on disk where policy is persisted.
should_finetune- Whether to load the policy for finetuning.
epoch_override- Override the number of epochs in persisted configuration for further finetuning.
**kwargs- Any other arguments
PolicyModelNotFound if the model is not found in the supplied
TED model architecture from https://arxiv.org/abs/1910.00486.
Intializes the TED model.
data_signature- the data signature of the input data
config- the model configuration
max_history_featurizer_is_used- if 'True' only the last dialogue turn will be used
label_data- the label data
entity_tag_specs- the entity tag specifications
Calculates the loss for the given batch.
batch_in- The batch.
The loss of the given batch.
Prepares the model for prediction.
Predicts the output of the given batch.
batch_in- The batch.
The output to predict.