A Policy decides what action to take at every step in a dialogue

class rasa_core.policies.Policy(featurizer: Optional[rasa_core.featurizers.TrackerFeaturizer] = None, priority: Optional[int] = 1)[source]
featurize_for_training(training_trackers: List[rasa_core.trackers.DialogueStateTracker], domain: rasa_core.domain.Domain, **kwargs) → rasa_core.training.data.DialogueTrainingData[source]

Transform training trackers into a vector representation. The trackers, consisting of multiple turns, will be transformed into a float vector which can be used by a ML model.

train(training_trackers: List[rasa_core.trackers.DialogueStateTracker], domain: rasa_core.domain.Domain, **kwargs) → None[source]

Trains the policy on given training trackers.

predict_action_probabilities(tracker: rasa_core.trackers.DialogueStateTracker, domain: rasa_core.domain.Domain) → List[float][source]

Predicts the next action the bot should take after seeing the tracker.

Returns the list of probabilities for the next actions

classmethod load(path: str) → rasa_core.policies.policy.Policy[source]

Loads a policy from the storage. Needs to load its featurizer

persist(path: str) → None[source]

Persists the policy to a storage.

Have questions or feedback?

We have a very active support community on Rasa Community Forum that is happy to help you with your questions. If you have any feedback for us or a specific suggestion for improving the docs, feel free to share it by creating an issue on Rasa Core GitHub repository.