My stories.yml not follow a given path

Why stories.yml is not working properly. It doesn’t follow a given path.

(This is my Config.yml file):-

recipe: default.v1 language: en

pipeline:

  • name: WhitespaceTokenizer
  • name: RegexFeaturizer “case_sensitive”: False
  • name: RegexEntityExtractor case_sensitive: False use_lookup_tables: True use_regexes: True
  • name: CountVectorsFeaturizer
  • name: CountVectorsFeaturizer analyzer: char_wb min_ngram: 1 max_ngram: 4
  • name: DIETClassifier epochs: 200 transformers_layers: 4 constrain_similarities: true
  • name: EntitySynonymMapper
  • name: ResponseSelector epochs: 200 constrain_similarities: true
  • name: FallbackClassifier threshold: 0.3 ambiguity_threshold: 0.1

policies:

  • name: MemoizationPolicy
  • name: RulePolicy
  • name: TEDPolicy max_history: 10 epochs: 200 batch_size: 50

Can any one help me ?

Hi @VijayChatBot, can you provide your stories and explain the issue you are facing with the story?

This is my stories.yml file :slight_smile:

version: “3.1”

stories:

  • story: happy path steps:

    • intent: greet
    • action: utter_greet
    • intent: mood_great
    • action: utter_happy
  • story: sad path 1 steps:

    • intent: greet
    • action: utter_greet
    • intent: mood_unhappy
    • action: utter_cheer_up
    • action: utter_did_that_help
    • intent: affirm
    • action: utter_happy
  • story: sad path 2 steps:

    • intent: greet
    • action: utter_greet
    • intent: mood_unhappy
    • action: utter_cheer_up
    • action: utter_did_that_help
    • intent: deny
    • action: utter_goodbye

-------------------------- # Order Status # -------------------------##

  • story: interactive_story_1 steps:

    • intent: greet
    • action: utter_greet
    • intent: order_details
    • action: utter_order_Id
    • intent: order entities:
      • order_id: A1HIZ1199
    • slot_was_set:
      • order_id: A1HIZ1199
    • action: action_order_status
    • intent: affirm
    • action: utter_greet
  • story: interactive_story_2 steps:

    • intent: greet
    • action: utter_greet
    • intent: order_details
    • action: utter_order_Id
    • intent: order entities:
      • order_id: L0DQGQ191
    • slot_was_set:
      • order_id: L0DQGQ191
    • action: action_order_status
    • intent: deny
    • action: utter_did_that_resolve
    • intent: affirm
    • action: utter_thank_feedback
  • story: interactive_story_3 steps:

    • intent: greet
    • action: utter_greet
    • intent: order_details
    • action: utter_order_Id
    • intent: order entities:
      • order_id: L0DQGQ191
    • slot_was_set:
      • order_id: L0DQGQ191
    • action: action_order_status
    • intent: deny
    • action: utter_did_that_resolve
    • intent: deny
    • action: utter_greet

-------------------------- For refund ----------------------------##

  • story: interactive_story_4 steps:
    • intent: greet
    • action: utter_greet
    • intent: refund
    • action: utter_order_Id
    • intent: order entities:
      • order_id: L0DQGQ191
    • slot_was_set:
      • order_id: L0DQGQ191
    • action: action_refund

-------------------------- For Brands ----------------------------##

  • story: interactive_story_5 steps:

    • intent: greet
    • action: utter_greet
    • intent: order_brands entities:
      • search: nike
      • search: nike
    • slot_was_set:
      • search: nike
    • action: action_search_Brands
    • intent: affirm
    • action: utter_greet
  • story: interactive_story_6 steps:

    • intent: greet
    • action: utter_greet
    • intent: order_brands entities:
      • search: nike
      • search: nike
    • slot_was_set:
      • search: nike
    • action: action_search_Brands
    • intent: deny
    • action: utter_did_that_resolve
    • intent: affirm
    • action: utter_thank_feedback
  • story: interactive_story_7 steps:

    • intent: greet
    • action: utter_greet
    • intent: order_brands entities:
      • search: nike
      • search: nike
    • slot_was_set:
      • search: nike
    • action: action_search_Brands
    • intent: deny
    • action: utter_did_that_resolve
    • intent: deny
    • action: utter_greet

-------------------------- show product ----------------------------##

  • story: interactive_story_8 steps:

    • intent: greet
    • action: utter_greet
    • intent: show_products entities:
      • category: men’s
      • color: voilet
      • subcategory: shirt
    • slot_was_set:
      • category: men’s
    • slot_was_set:
      • color: voilet
    • slot_was_set:
      • subcategory: shirt
    • action: action_show_product
    • intent: affirm
    • action: utter_greet
  • story: interactive_story_9 steps:

    • intent: greet
    • action: utter_greet
    • intent: show_products entities:
      • category: men’s
      • color: voilet
      • subcategory: shirt
    • slot_was_set:
      • category: men’s
    • slot_was_set:
      • color: voilet
    • slot_was_set:
      • subcategory: shirt
    • action: action_show_product
    • intent: deny
    • action: utter_did_that_resolve
    • intent: affirm
    • action: utter_thank_feedback
  • story: interactive_story_10 steps:

    • intent: greet
    • action: utter_greet
    • intent: show_products entities:
      • category: men’s
      • color: voilet
      • subcategory: shirt
    • slot_was_set:
      • category: men’s
    • slot_was_set:
      • color: voilet
    • slot_was_set:
      • subcategory: shirt
    • action: action_show_product
    • intent: deny
    • action: utter_did_that_resolve
    • intent: deny
    • action: utter_greet

-------------------- show subcategory with size ---------------------

  • story: interactive_story_11 steps:
    • intent: greet
    • action: utter_greet
    • intent: show_subcategory_size entities:
      • subcategory: t-shirt
      • size: medium
    • slot_was_set:
      • subcategory: shirt
    • slot_was_set:
      • size: medium
    • action: action_show_subcategory_size

The main problem is that when I am running my bot it does not follow proper path. It means suppose when I want to go with (refund process) that is (interactive_story_4) it does not follow that Refund path it follows other path like (order status) path that is (interactive_story_1 and other). Even same problem goes with (subcategory with size) process. suppose I want to go with (interactive_story_11) then it doesn’t follow that path it follows (show product) process that is (interactive_story_8).

Please help me to resolve this issue.

It is likely due to confusion in intent prediction due to similar training examples for different intents. You can use CLI rasa shell nlu to interpret the messages on the command line using your NLU model.

Using this, you can make sure whether the intent prediction is correct for the user message, which will reflect in the stories.

Thank you for your answer . I tried but still not working. Is their any issue in my Config.yml file ? .

can you do rasa test and share the Intent Confusion Matrix?

Sorry for late reply, I have done intent confusion matrix please see,

When we are talking about entity extraction. The confusion matrix of entity is

My config.yml file is same as above mention.