rasa.core.policies._policy
Policy Objects
Common parent class for all dialogue policies.
supported_data
The type of data supported by this policy.
By default, this is only ML-based training data. If policies support rule data, or both ML-based data and rule data, they need to override this method.
Returns:
The data type supported by this policy (ML-based training data).
__init__
Constructs a new Policy object.
featurizer
Returns the policy's featurizer.
set_shared_policy_states
Sets policy's shared states for correct featurization.
train
Trains the policy on given training trackers.
Arguments:
training_trackers:
the list of the :class:rasa.core.trackers.DialogueStateTracker
domain
- the :class:rasa.shared.core.domain.Domain
interpreter
- Interpreter which can be used by the polices for featurization.**kwargs
- Additional keyword arguments.
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 storage.
Arguments:
path
- Path to persist policy to.
load
Loads a policy from path.
Arguments:
path
- Path to load policy from.
Returns:
An instance of Policy
.
format_tracker_states
Format tracker states to human readable format on debug log.
Arguments:
states
- list of tracker states dicts
Returns:
the string of the states with user intents and actions