notice

This is documentation for Rasa Open Source Documentation v2.0.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (2.1.x).

Version: 2.0.x

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.