Why are my rules not being applied?

I have a rule that says intent: greet should follow with utter_greet, but this isn’t working.

I have a story and rule examples as follows:

- story: Greeting
  steps:
  - intent: greet
  - action: utter_greet
  - action: name_form
  - active_loop: name_form
- rule: Say `hello` at start conversation with intent `greet`
  steps:
  - intent: greet
  - action: utter_greet
  - action: name_form

I have added RulePolicy to my config like so:

policies:
  - name: "MemoizationPolicy"
    max_history: 3
  - name: TEDPolicy
    epochs: 200
  - name: RulePolicy

But when it comes to testing, intent: greet is following with name_form skipping the utter_greet action entirely.

In order to test my rules were being picked up at all, I changed my rule to contradict my stories. When I run train command I get no warning / error about contradiction. My guess is my rules file isn’t being used at all. Any ideas?

edit- I should mention I’m not using default data directory but specifying another. This doesn’t seem to be a problem for the nlu.yml or stories.yml.

1 Like

I did get a “Incomplete rules found🚨” error in the end - so perhaps there was something odd going on with my docker container.

Unfortunately, I’m still getting an unexpected prediction of name_form instead of utter_greet despite my rule.

You are using the memorization policy

Is that a problem? It’s very similar to this example config in the docs: Policies

what version are you using

I’m using rasa:2.2.4

Is it going to the forms?

Yes the intent: greet goes straight to form skipping utter_greet, if that’s what you mean.

I misunderstood the memoization policy, I think this in combination with some ambiguous end to end stories might be causing trouble. I’m going to try without it. Thanks for the suggestion @prakashr

:+1: