rasa.core.policies._ted_policy
TEDPolicy Objects
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:
__init__
Declares instance variables with default values.
model_class
Gets the class of the model architecture to be used by the policy.
Returns:
Required class.
run_training
Feeds the featurized training data to the model.
Arguments:
model_data
- Featurized training data.label_ids
- Label ids corresponding to the data points inmodel_data
. These may or may not be used by the function depending on how the policy is trained.
train
Trains the policy on given training trackers.
Arguments:
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.
predict_action_probabilities
Predicts the next action the bot should take after seeing the tracker.
Arguments:
tracker
- the :class:rasa.core.trackers.DialogueStateTracker
domain
- the :class:rasa.shared.core.domain.Domain
interpreter
- Interpreter which may be used by the policies to create additional features.
Returns:
The policy's prediction (e.g. the probabilities for the actions).
persist
Persists the policy to a storage.
persist_model_utilities
Persists model's utility attributes like model weights, etc.
Arguments:
model_path
- Path where model is to be persisted
load
Loads a policy from the storage.
Arguments:
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
Returns:
Loaded policy
Raises:
PolicyModelNotFound
if the model is not found in the supplied path
.