notice
This is documentation for Rasa Open Source Documentation v2.1.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (2.2.x).
Version: 2.1.x
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) -> 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.
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).