Saving Slot Data and Building Forms

Trouble saving Slot data for complete set of data? Forms not rendering? Let’s talk.

I have an issue with saving data in Slots. Below are the relevant files. The starting point is “rasa init”. First Problem: When I use the utter_ask_[intent] feature does not store the data in the slot. Second Problem: When I added a form, it never renders. The Shell never replies until timeout. Here is the code: nlu.yml version: “2.0” nlu:

  • intent: jobticket examples: |
    • depo
    • deposition
    • jobtitcket
    • reporter
    • videographer
  • intent: service examples: |
    • app
    • 2 day turn around
    • 3 day turn around
    • 4 day turn around
    • 5 day turn around
    • 6 day turn around
  • intent: greet examples: |
    • hey
    • hello
    • hi
    • hello there
    • good morning
    • good evening
    • moin
    • hey there
    • let’s go
    • hey dude
    • goodmorning
    • goodevening
    • good afternoon
  • intent: goodbye examples: |
    • good afternoon
    • cu
    • good by
    • cee you later
    • good night
    • bye
    • goodbye
    • have a nice day
    • see you around
    • bye bye
    • see you later
  • intent: affirm examples: |
    • yes
    • y
    • indeed
    • of course
    • that sounds good
    • correct
  • intent: deny examples: |
    • no
    • n
    • never
    • I don’t think so
    • don’t like that
    • no way
    • not really
  • intent: mood_great examples: |
    • perfect
    • great
    • amazing
    • feeling like a king
    • wonderful
    • I am feeling very good
    • I am great
    • I am amazing
    • I am going to save the world
    • super stoked
    • extremely good
    • so so perfect
    • so good
    • so perfect
    • exit
  • intent: mood_unhappy examples: |
    • my day was horrible
    • I am sad
    • I don’t feel very well
    • I am disappointed
    • super sad
    • I’m so sad
    • sad
    • very sad
    • unhappy
    • not good
    • not very good
    • extremly sad
    • so saad
    • so sad
  • intent: bot_challenge examples: |
    • are you a bot?
    • are you a human?
    • am I talking to a bot?
    • am I talking to a human?

domain.yml session_config: session_expiration_time: 60 carry_over_slots_to_new_session: true intents:

  • mood_great
  • mood_unhappy
  • greet
  • goodbye
  • affirm
  • deny
  • bot_challenge
  • jobticket
  • service entities:
  • depo
  • deposition
  • jobtitcket
  • reporter
  • videographer
  • app
  • 2 day turn around
  • 3 day turn around
  • 4 day turn around
  • 5 day turn around
  • 6 day turn around responses: utter_ask_jobticket:
    • text: what is the job? utter_ask_service:
    • text: what service will you need? 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. actions:
  • utter_cheer_up
  • utter_did_that_help
  • utter_greet
  • utter_happy
  • utter_ask_jobticket
  • utter_ask_service version: ‘2.0’

stories.yml version: “2.0”

stories:

  • story: jobticket steps:

    • intent: jobticket
    • action: utter_ask_jobticket
    • intent: service
    • action: utter_ask_service
  • 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: interactive_story_1 steps:

    • intent: greet
    • action: utter_greet
    • intent: mood_unhappy
    • action: utter_cheer_up
    • action: utter_did_that_help
    • intent: mood_great
    • action: utter_happy

config.yml

Configuration for Rasa NLU.

https://rasa.com/docs/rasa/nlu/components/

language: en

pipeline:

# No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.

# If you’d like to customize it, uncomment and adjust the pipeline.

# See Tuning Your NLU Model for more information.

- name: WhitespaceTokenizer

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

ambiguity_threshold: 0.1

Configuration for Rasa Core.

https://rasa.com/docs/rasa/core/policies/

policies:

# No configuration for policies was provided. The following default policies were used to train your model.

# If you’d like to customize them, uncomment and adjust the policies.

# See Policies for more information.

- name: MemoizationPolicy

- name: TEDPolicy

max_history: 5

epochs: 100

  • name: RulePolicy

endpoints.yml

This file contains the different endpoints your bot can use.

Server where the models are pulled from.

Model Storage

#models:

url: http://my-server.com/models/default_core@latest

wait_time_between_pulls: 10 # [optional](default: 100)

Server which runs your custom actions.

Custom Actions

#action_endpoint:

url: “http://localhost:5055/webhook

Tracker store which is used to store the conversations.

By default the conversations are stored in memory.

Tracker Stores

#tracker_store:

type: redis

url: <host of the redis instance, e.g. localhost>

port: <port of your redis instance, usually 6379>

db: <number of your database within redis, e.g. 0>

password:

use_ssl: <whether or not the communication is encrypted, default false>

#tracker_store:

type: mongod

url: <url to your mongo instance, e.g. mongodb://localhost:27017>

db: <name of the db within your mongo instance, e.g. rasa>

username:

password:

Event broker which all conversation events should be streamed to.

Event Brokers

#event_broker:

url: localhost

username: username

password: password

queue: queue

action_endpoint: url: “http://localhost:5055/webhook

Hi @glennrasa, to load extracted entities into slots, you’ll need to add the entity and slot definitions to your domain.yml file like this:

entities:
- ticket_service

slots:
   ticket_service:
     type: text

When slot is defined with the same name as an entity, it will automatically be saved into that slot upon NLU entity extraction.

You’ll also need to annotate your training data with entity labels since this is defined within the NLU data:

intent: service 
examples: |
 - [app](ticket_service)
 - [2 day turn around](ticket_service)

I don’t see any Form definitions in the data you’ve shared, but you can refer to our documentation for a step-by-step guide on how to create a Form: Handling Business Logic.

If the entity has a slot, it will be filled automatically. Do I need a form in order to do this?

@b-quachtran. What If I only need to analyze text for the entities and return the probabilities? Use the API with JSON Intents and Entities. What else would I need? Process: Framework calls Rasa API and sends text. The text is analyzed. The matching intents and entities probability are returned. No need for a chat.