UserWarning: Loading domain from 'domain.yml' failed. Using empty domain. Error: 'You need to specify a value for the key 'entity' in the slot mapping of type 'from_entity' for slot 'email' in the form 'newsletter_form'

stories.yml

version: "2.0"

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

- story: greet and subscribe
  steps:
    - intent: greet
    - action: utter_greet
    - intent: subscribe
    - action: newsletter_form
    - active_loop: newsletter_form
    - active_loop: null
    - action: utter_subscribed

domain.yml

version: "2.0"

intents:
  - greet
  - goodbye
  - affirm
  - deny
  - mood_great
  - mood_unhappy
  - bot_challenge
  - subscribe
  - inform_email
  - inform_frequency

entities:
  - email

forms:
  newsletter_form:
    required_slots:
      email:
        - type: from_entity
        - entity: email
      frequency: 
        - type: from_text
        - intent: inform_frequency

slots:
  email:
    type: text
    influence_conversation: false
  frequency:
    type: text
    influence_conversation: false


responses:
  utter_greet:
  - text: "Hey! How are you?"
  - text: Hi, how's it going?

  utter_ask_email:
  - text: What is your email address?
  utter_ask_frequency:
  - text: How often do you want to receive emails from me?
  utter_subscribed:
  - text: You're all set! Check your inbox at {email} to confirm your subscription.
          You will receive emails {frequency}.

  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."

session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true

Logs:

C:\Users\jayp\Projects\test>rasa data validate
The configuration for pipeline was chosen automatically. It was written into the config file at 'config.yml'.
C:\Users\jayp\Anaconda3\envs\rasa.8.4\lib\site-packages\rasa\shared\utils\io.py:97: UserWarning: Loading domain from 'domain.yml' failed. Using empty domain. Error: 'You need to specify a value for the key 'entity' in the slot mapping of type 'from_entity' for slot 'email' in the form 'newsletter_form'. Please see https://rasa.com/docs/rasa/forms for more information.'
C:\Users\jayp\Anaconda3\envs\rasa.8.4\lib\site-packages\rasa\shared\utils\io.py:97: UserWarning: Issue found in 'data\rules.yml':
Found intent 'goodbye' in stories which is not part of the domain.
  More info at https://rasa.com/docs/rasa/stories
C:\Users\jayp\Anaconda3\envs\rasa.8.4\lib\site-packages\rasa\shared\utils\io.py:97: UserWarning: Issue found in 'data\rules.yml':
Found intent 'bot_challenge' in stories which is not part of the domain.
  More info at https://rasa.com/docs/rasa/stories
C:\Users\jayp\Anaconda3\envs\rasa.8.4\lib\site-packages\rasa\shared\utils\io.py:97: UserWarning: Issue found in 'data\stories.yml':
Found intent 'greet' in stories which is not part of the domain.
  More info at https://rasa.com/docs/rasa/stories
C:\Users\jayp\Anaconda3\envs\rasa.8.4\lib\site-packages\rasa\shared\utils\io.py:97: UserWarning: Issue found in 'data\stories.yml':
Found intent 'mood_great' in stories which is not part of the domain.
  More info at https://rasa.com/docs/rasa/stories
C:\Users\jayp\Anaconda3\envs\rasa.8.4\lib\site-packages\rasa\shared\utils\io.py:97: UserWarning: Issue found in 'data\stories.yml':
Found intent 'mood_unhappy' in stories which is not part of the domain.
  More info at https://rasa.com/docs/rasa/stories
C:\Users\jayp\Anaconda3\envs\rasa.8.4\lib\site-packages\rasa\shared\utils\io.py:97: UserWarning: Issue found in 'data\stories.yml':
Found intent 'affirm' in stories which is not part of the domain.
  More info at https://rasa.com/docs/rasa/stories
C:\Users\jayp\Anaconda3\envs\rasa.8.4\lib\site-packages\rasa\shared\utils\io.py:97: UserWarning: Issue found in 'data\stories.yml':
Found intent 'deny' in stories which is not part of the domain.
  More info at https://rasa.com/docs/rasa/stories
C:\Users\jayp\Anaconda3\envs\rasa.8.4\lib\site-packages\rasa\shared\utils\io.py:97: UserWarning: Issue found in 'data\stories.yml':
Found intent 'subscribe' in stories which is not part of the domain.
  More info at https://rasa.com/docs/rasa/stories
Project validation completed with errors.

For email slot, the slot type specified under forms is from_entity and the slot type specified under slots is text. You can change this to from_entity and try training again.

forms:
  newsletter_form:
    required_slots:
      email:
        - type: from_entity
        - entity: email
slots:
  email:
    type: text
    influence_conversation: false

i set the email slot type to “from_entity” and got below error:

slots:
  email:
    type: from_entity
  frequency:
    type: text
InvalidSlotTypeException: Failed to find slot type, 'from_entity' is neither a known type nor user-defined. If you are creating your own slot type, make sure its module path is correct. You can find all build in types at https://rasa.com/docs/rasa/domain#slots

Sorry, there was a little confusion between 2.x and 3.x!

No worries. Looks like there some issue with the way i’m setting up entity and intent and type from_entity and from_intent. if i comment out those part and keep type as from_text then it works.

forms:
  newsletter_form:
    required_slots:
      email:
        - type: from_text
        # - entity: email
      frequency: 
        - type: from_text
        # - intent: inform_frequency

But keeping “from_text” is taking whole text from the user instead of just extracting email.

The from_text slot mapping will always set the slot with the whole user utterance. You can try using regex or duckling for email extraction.

As per my understanding after reading documentation both regex or duckling used to extract entity but in my case i don’t have issue extracting entity. i have issue with form where i’m not able to fill the form slot using “from_entity” and giving me a below error when trying to train the model.

UserWarning: Loading domain from 'domain.yml' failed. Using empty domain. Error: 'You need to specify a value for the key 'entity' in the slot mapping of type 'from_entity' for slot 'email' in the form 'newsletter_form'. Please see https://rasa.com/docs/rasa/forms for more information.'