Bot is not asking for slots in form

Hi all,

I was trying to create form based chat following the tutorial Tutorial: Building Assistants but the bot never predicts the form utter_movie_genre action but it always predicts the 'action_listen’

    Your input ->  Please suggest a film
2020-03-18 22:10:14 DEBUG    rasa.core.tracker_store  - Creating a new tracker for id 'default'.
2020-03-18 22:10:14 DEBUG    rasa.core.processor  - Starting a new session for conversation ID 'default'.
2020-03-18 22:10:14 DEBUG    rasa.core.processor  - Action 'action_session_start' ended with events '[<rasa.core.events.SessionStarted object at 0x148fb9b00>, <rasa.core.events.ActionExecuted object at 0x148fb9ac8>]'.
2020-03-18 22:10:14 DEBUG    rasa.core.processor  - Current slot values:
	langi: None
	movie_genre: None
	recencyi: None
	requested_slot: None
	stari: None
2020-03-18 22:10:14 DEBUG    rasa.core.processor  - Received user message 'Please suggest a film' with intent '{'name': 'movie_suggest', 'confidence': 0.9975939393043518}' and entities '[]'
2020-03-18 22:10:14 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 4 events.
2020-03-18 22:10:14 DEBUG    rasa.core.policies.memoization  - Current tracker state [None, None, None, {}, {'intent_movie_suggest': 1.0, 'prev_action_listen': 1.0}]
2020-03-18 22:10:14 DEBUG    rasa.core.policies.memoization  - There is a memorised next action '20'
2020-03-18 22:10:14 DEBUG    rasa.core.policies.form_policy  - There is no active form
2020-03-18 22:10:14 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_0_MemoizationPolicy
2020-03-18 22:10:14 DEBUG    rasa.core.processor  - Predicted next action 'movie_form' with confidence 1.00.
2020-03-18 22:10:14 DEBUG    rasa.core.actions.action  - Calling action endpoint to run action 'movie_form'.
2020-03-18 22:10:14 DEBUG    rasa.core.processor  - Action 'movie_form' ended with events '[<rasa.core.events.Form object at 0x14906e208>, <rasa.core.events.SlotSet object at 0x14906e240>]'.
2020-03-18 22:10:14 DEBUG    rasa.core.processor  - Current slot values:
	langi: None
	movie_genre: None
	recencyi: None
	requested_slot: movie_genre
	stari: None
2020-03-18 22:10:14 DEBUG    rasa.core.policies.memoization  - Current tracker state [None, None, None, {}, {'intent_movie_suggest': 1.0, 'prev_action_listen': 1.0}]
2020-03-18 22:10:14 DEBUG    rasa.core.policies.memoization  - There is a memorised next action '20'
2020-03-18 22:10:14 DEBUG    rasa.core.policies.mapping_policy  - There is no mapped action for the predicted intent, 'movie_suggest'.
2020-03-18 22:10:14 DEBUG    rasa.core.policies.form_policy  - There is an active form 'movie_form'
2020-03-18 22:10:14 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_3_FormPolicy
2020-03-18 22:10:14 DEBUG    rasa.core.processor  - Predicted next action 'action_listen' with confidence 1.00.
2020-03-18 22:10:14 DEBUG    rasa.core.processor  - Action 'action_listen' ended with events '[]'.
2020-03-18 22:10:14 DEBUG    rasa.core.lock_store  - Deleted lock for conversation 'default'.

In story, I have

movie 1

  • movie_suggest
    • movie_form
    • form{“name”: “movie_form”}
    • form{“name”: null}

In action.py

    class MovieForm(FormAction):
        """Collects personal preference to suggest the movie"""

        def name(self):
            return "movie_form"
        def submit(
                self,
                dispatcher: CollectingDispatcher,
                tracker: Tracker,
                domain: Dict[Text, Any],
            ) -> List[Dict]:

            dispatcher.utter_message("Thanks for getting in touch, we’ll contact you soon")
            return []
        @staticmethod
        def required_slots(tracker):
            return [
                "movie_genre",
                "langi",
                "stari",
                "recencyi",
                ]

In domain.yml template section I have utter_movie_genre: - text: Movie genre please?

  utter_langi:
  - text: Orginal language of movie?

  utter_stari:
  - text: Whos the leading star?

  utter_recencyi:
  - text: How old the movie can be ( recent < 1 year, for others specify no)?

In nlu.md

## intent:movie_suggest
- Please suggest a film
- Please suggest a movie
- Suggest a movie
- Suggest a film
- Movie please
- film please

Config file

language: en
pipeline:
- name: "WhitespaceTokenizer"
- name: "RegexFeaturizer"
- name: "CRFEntityExtractor"
- name: "EntitySynonymMapper"
- name: "CountVectorsFeaturizer"
- name: "CountVectorsFeaturizer"
  analyzer: "char_wb"
  min_ngram: 1
  max_ngram: 4
- name: "EmbeddingIntentClassifier"

# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
  - name: MemoizationPolicy
  - name: KerasPolicy
  - name: MappingPolicy
  - name: FormPolicy

It’s my first attempt with rasa form and I could not figure out why it’s not predicting it.
Can someone please share some suggestions

Could you please post you domain.yml?

@saurabh-m523 Please find the domain.yml

intents:
  - greet
  - goodbye
  - affirm
  - deny
  - mood_great
  - mood_unhappy
  - bot_challenge
  - movie_suggest
  - movieform

actions:
- utter_greet
- utter_cheer_up
- utter_did_that_help
- utter_happy
- utter_goodbye
- utter_iamabot
- utter_movie_genre
- utter_langi
- utter_stari
- utter_recencyi

forms:
  - movie_form

slots:
  movie_genre:
    type: unfeaturized
  langi:
    type: unfeaturized
  stari:
    type: unfeaturized
  recencyi:
    type: unfeaturized

entities:
  - movie_genre
  - langi
  - stari
  - recencyi

templates:
  utter_greet:
  - text: "Hey! How are you?"

  utter_cheer_up:
  - text: "Here is something to cheer you up:"
    image: "https://i.imgur.com/nGF1K8f.jpg"

  utter_did_that_help:
  - text: "Did that help you?"

  utter_happy:
  - text: "Great, carry on!"

  utter_goodbye:
  - text: "Bye"

  utter_iamabot:
  - text: "I am a bot, powered by Rasa."

  utter_movie_genre:
  - text: Movie genre please?

  utter_langi:
  - text: Orginal language of movie?

  utter_stari:
  - text: Whos the leading star?

  utter_recencyi:
  - text: How old the movie can be ( recent < 1 year, for others specify no)?

hello naddeeshtv, for the action form utter_movie_genre to work you must add after utter ask for example utter_ask_movie_genre, utter_ask_langi …

1 Like

You should have something like in your domain

 utter_ask_movie_genre:
  - text: Movie genre please?
1 Like

Don’t forget to correct it in actions:

actions:
- utter_ask_movie_genre

As you can see, it asks with utter_ask_{slot} for the slot you define in

So you should have something like

utter_ask_movie_genre

utter_ask_langi

utter_ask_stari

utter_ask_recencyi

in your domain.yml