notice

This is unreleased documentation for Rasa Open Source Documentation Master/Unreleased version.
For the latest released documentation, see the latest version (2.0.x).

Version: Master/Unreleased

rasa.core.policies.mapping_policy

MappingPolicy Objects

class MappingPolicy(Policy)

Policy which maps intents directly to actions.

Intents can be assigned actions in the domain file which are to be executed whenever the intent is detected. This policy takes precedence over any other policy.

__init__

| __init__(priority: int = MAPPING_POLICY_PRIORITY) -> None

Create a new Mapping policy.

train

| train(training_trackers: List[TrackerWithCachedStates], domain: Domain, interpreter: NaturalLanguageInterpreter, **kwargs: Any, ,) -> None

Does nothing. This policy is deterministic.

predict_action_probabilities

| predict_action_probabilities(tracker: DialogueStateTracker, domain: Domain, interpreter: NaturalLanguageInterpreter, **kwargs: Any, ,) -> List[float]

Predicts the assigned action.

If the current intent is assigned to an action that action will be predicted with the highest probability of all policies. If it is not the policy will predict zero for every action.