notice
This is unreleased documentation for Rasa Open Source Documentation Master/Unreleased version.
For the latest released documentation, see the latest version (2.2.x).
Version: Master/Unreleased
rasa.core.policies.rule_policy
InvalidRule Objects
class InvalidRule(RasaException)
Exception that can be raised when rules are not valid.
RulePolicy Objects
class RulePolicy(MemoizationPolicy)
Policy which handles all the rules
supported_data
| @staticmethod
| supported_data() -> SupportedData
The type of data supported by this policy.
Returns:
The data type supported by this policy (ML and rule data).
__init__
| __init__(featurizer: Optional[TrackerFeaturizer] = None, priority: int = RULE_POLICY_PRIORITY, lookup: Optional[Dict] = None, core_fallback_threshold: float = DEFAULT_CORE_FALLBACK_THRESHOLD, core_fallback_action_name: Text = ACTION_DEFAULT_FALLBACK_NAME, enable_fallback_prediction: bool = True, restrict_rules: bool = True, check_for_contradictions: bool = True, **kwargs: Any, ,) -> None
Create a RulePolicy
object.
Arguments:
featurizer
-Featurizer
which is used to convert conversation states to features.priority
- Priority of the policy which is used if multiple policies predict actions with the same confidence.lookup
- Lookup table which is used to pick matching rules for a conversation state.core_fallback_threshold
- Confidence of the prediction if no rule matched and de-facto threshold for a core fallback.core_fallback_action_name
- Name of the action which should be predicted if no rule matched.enable_fallback_prediction
- IfTrue
core_fallback_action_name
is predicted in case no rule matched.restrict_rules
- IfTrue
rules are restricted to contain a maximum of 1 user message. This is used to avoid that users build a state machine using the rules.check_for_contradictions
- Check for contradictions.
predict_action_probabilities
| predict_action_probabilities(tracker: DialogueStateTracker, domain: Domain, interpreter: NaturalLanguageInterpreter, **kwargs: Any, ,) -> PolicyPrediction
Predicts the next action (see parent class for more information).