Apologies in advance for the long post. I’m using rasa version 2.4.3 and rasa-sdk version 2.4.1.
The background is that after thoroughly testing the bot locally, I trained a model (let’s call this file
model-ci.tar.gz for convenience) through a CI process that takes the same training examples (nlu and stories) and config.yml that I had pushed to my git repo.
My initial understanding was that the model file once created can function on its own without needing the training examples to exist somewhere accessible every time.
The bot in production that uses
model-ci.tar.gz, started to incorrectly fall back after the first utterance itself. I downloaded the same file
model-ci.tar.gz, and ran the exact same utterance with that model served on a local Rasa server and it gave the right response. This difference in behavior was consistently reproduced.
Also, note that I trigger a conversation by passing the bot entities extracted from before the conversation starts, and in both cases all slots before the first intent are correctly set in the tracker.
I investigated the tracker for both these conversations. For the correct behavior (
model-ci.tar.gz served in a local rasa server), I saw the correct actions predicted by
policy_0_MemoizationPolicy. For the wrong behavior however (
model-ci.tar.gz served in a production env), I noticed that a correct action was first predicted by
policy_1_TEDPolicy instead, and then the wrong action that broke the bot was predicted by
My config.yml is the same on my local files and on the git repo from which CI trained
model-ci.tar.gz. Here’s what it looks like -
# Alternative pipeline with spaCy language: "en_core_web_md" # your two-letter language code pipeline: - name: SpacyNLP - name: SpacyTokenizer - name: SpacyFeaturizer - name: RegexFeaturizer - name: LexicalSyntacticFeaturizer - name: CountVectorsFeaturizer - name: CountVectorsFeaturizer analyzer: "char_wb" min_ngram: 1 max_ngram: 4 - name: DIETClassifier epochs: 100 - name: EntitySynonymMapper - name: ResponseSelector epochs: 100 - name: FallbackClassifier threshold: 0.6 ambiguity_threshold: 0.1 # Configuration for Rasa Core. # https://rasa.com/docs/rasa/core/policies/ policies: - name: MemoizationPolicy - name: TEDPolicy - name: RulePolicy core_fallback_threshold: 0.3 core_fallback_action_name: fallback_action
I’m confused as to why the Memoization policy was ignored in the case where the bot failed. I don’t have any rules added, since I’m strictly using stories.yml to manage my dialogs. I’m using the exact same model-ci.tar.gz, and I’m passing it identical curl requests with identical payloads to continue the conversation. So why is one behavior so vastly different from the other and consistently so?
Does the memoization policy have any kind of dependency that I need to set up? Does the order of the policies in the config.yml file matter (since Rasa also has the default priorities set)? Are training examples and the config.yml are still sought after, once the model is served? What else should I look into to resolve this discrepancy?
Many thanks in advance for any suggestions you can share.