Hi, i have a form to get any user input , according to this docs Forms the form can take any user intent as input if intent_name is set to None. but its not working, i put text “Atlus” and its identified as affirm, but the form “Failed to extract requested slot” , what i’m missing here? is the docs inaccurate? here is the full debug :
debug
Your input -> Atlus
2021-11-17 03:11:13 DEBUG rasa.core.lock_store - Issuing ticket for conversation 'b2bfece925d24b63933bdfd10408262e'.
2021-11-17 03:11:13 DEBUG rasa.core.lock_store - Acquiring lock for conversation 'b2bfece925d24b63933bdfd10408262e'.
2021-11-17 03:11:13 DEBUG rasa.core.lock_store - Acquired lock for conversation 'b2bfece925d24b63933bdfd10408262e'.
2021-11-17 03:11:13 DEBUG rasa.core.tracker_store - Recreating tracker for id 'b2bfece925d24b63933bdfd10408262e'
2021-11-17 03:11:13 DEBUG rasa.nlu.classifiers.diet_classifier - There is no trained model for 'ResponseSelector': The component is either not trained or didn't receive enough training data.
2021-11-17 03:11:13 DEBUG rasa.nlu.selectors.response_selector - Adding following selector key to message property: default
2021-11-17 03:11:13 DEBUG rasa.core.processor - Received user message 'Atlus' with intent '{'id': -7145039449810149554, 'name': 'affirm', 'confidence': 0.8838119506835938}' and entities '[]'
2021-11-17 03:11:13 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 11 events.
2021-11-17 03:11:13 DEBUG rasa.core.policies.rule_policy - Current tracker state:
[state 1] user intent: ask_status_vaccination | previous action name: action_listen
[state 2] user intent: ask_status_vaccination | previous action name: vaccination_form | active loop: {'name': 'vaccination_form'}
[state 3] user text: Atlus | previous action name: action_listen | active loop: {'name': 'vaccination_form'}
2021-11-17 03:11:13 DEBUG rasa.core.policies.rule_policy - There is no applicable rule.
2021-11-17 03:11:13 DEBUG rasa.core.policies.rule_policy - Predicted loop 'vaccination_form'.
2021-11-17 03:11:13 DEBUG rasa.core.policies.ensemble - Made prediction using user intent.
2021-11-17 03:11:13 DEBUG rasa.core.policies.ensemble - Added `DefinePrevUserUtteredFeaturization(False)` event.
2021-11-17 03:11:13 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_RulePolicy.
2021-11-17 03:11:13 DEBUG rasa.core.processor - Predicted next action 'vaccination_form' with confidence 1.00.
2021-11-17 03:11:13 DEBUG rasa.core.actions.forms - Validating user input 'UserUttered(text: Atlus, intent: affirm, use_text_for_featurization: False)'.
2021-11-17 03:11:13 DEBUG rasa.core.actions.forms - Trying to extract requested slot 'patient_name' ...
2021-11-17 03:11:13 DEBUG rasa.core.actions.forms - Got mapping '{'type': 'from_text', 'intent': 'None'}'
2021-11-17 03:11:13 DEBUG rasa.core.actions.forms - Failed to extract requested slot 'patient_name'
2021-11-17 03:11:13 DEBUG rasa.core.actions.forms - Validating extracted slots: {}
2021-11-17 03:11:13 DEBUG rasa.core.policies.rule_policy - Current tracker state:
[state 1] user intent: ask_status_vaccination | previous action name: action_listen
[state 2] user intent: ask_status_vaccination | previous action name: vaccination_form | active loop: {'name': 'vaccination_form'}
[state 3] previous action name: action_listen | active loop: {'name': 'vaccination_form'}
2021-11-17 03:11:13 DEBUG rasa.core.policies.rule_policy - There is no applicable rule.
2021-11-17 03:11:13 DEBUG rasa.core.policies.rule_policy - Current tracker state:
[state 1] user intent: ask_status_vaccination | previous action name: action_listen
[state 2] user intent: ask_status_vaccination | previous action name: vaccination_form | active loop: {'name': 'vaccination_form'}
[state 3] user intent: affirm | previous action name: action_listen | active loop: {'name': 'vaccination_form'}
2021-11-17 03:11:13 DEBUG rasa.core.policies.rule_policy - There is no applicable rule.
2021-11-17 03:11:13 DEBUG rasa.core.policies.ensemble - Execution of 'vaccination_form' was rejected. Setting its confidence to 0.0 in all predictions.
2021-11-17 03:11:13 DEBUG rasa.core.policies.ensemble - Made prediction using user intent.
2021-11-17 03:11:13 DEBUG rasa.core.policies.ensemble - Added `DefinePrevUserUtteredFeaturization(False)` event.
2021-11-17 03:11:13 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_RulePolicy.
2021-11-17 03:11:13 DEBUG rasa.core.processor - Predicted next action 'action_default_fallback' with confidence 0.30.
2021-11-17 03:11:13 DEBUG rasa.core.processor - Policy prediction ended with events '[<rasa.shared.core.events.DefinePrevUserUtteredFeaturization object at 0x7fdd2bf02130>]'.
2021-11-17 03:11:13 DEBUG rasa.core.processor - Action 'action_default_fallback' ended with events '[<rasa.shared.core.events.UserUtteranceReverted object at 0x7fdd2b8a4250>]'.
2021-11-17 03:11:13 DEBUG rasa.core.processor - Current slot values:
patient_name: None
requested_slot: patient_name
session_started_metadata: None
2021-11-17 03:11:13 DEBUG rasa.core.policies.rule_policy - Predicted 'action_listen' after loop 'vaccination_form'.
2021-11-17 03:11:13 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_0_RulePolicy.
2021-11-17 03:11:13 DEBUG rasa.core.processor - Predicted next action 'action_listen' with confidence 1.00.
2021-11-17 03:11:13 DEBUG rasa.core.processor - Policy prediction ended with events '[]'.
2021-11-17 03:11:13 DEBUG rasa.core.processor - Action 'action_listen' ended with events '[]'.
2021-11-17 03:11:13 DEBUG rasa.core.lock_store - Deleted lock for conversation 'b2bfece925d24b63933bdfd10408262e'.
domain.yml
version: '2.0'
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
intents:
- greet
- affirm
- out_of_context
- goodbye
- deny
- give_name
- ask_status_vaccination
entities:
- person_name
slots:
patient_name:
type: text
influence_conversation: false
forms:
vaccination_form:
required_slots:
patient_name:
- type: from_text
intent: None
responses:
utter_greet:
- text: Halo! ada yang bisa saya bantu?
utter_goodbye:
- text: Sampai jumpa!
utter_thanks:
- text: Terima kasih!
actions:
- utter_greet
- utter_thanks
- utter_goodbye
- action_out_of_context
- action_ask_patient_name
nlu.yml (its actualy super long so i shorten it)
version: "2.0"
nlu:
- intent: greet
examples: |
- haloo
- hi
- apa kabar?
- oi
- permisi
- selamat siang
- Selamat pagi
- Selamat siang
- Selamat sore
- mo tanya
- halo
- intent: goodbye
examples: |
- ok
- sip
- thnx
- ok gan
- dah
- dadah
- sudah cukup
- cukup
- ckp
- intent: affirm
examples: |
- iya
- yes
- ya
- ok
- betul
- benar
- setuju
- iye
- y
- mau
- intent: deny
examples: |
- ga
- ngga
- ogah
- tidak
- tdk
- tidak setuju
- ga setuju
- ga jadi
- ga deh
- tidak mau
- tak mau
- kok gitu
- intent: ask_status_vaccination
examples: |
- saya ingin tahu status vaksinasi saya
- ingin tau status vaksinasi
- ingin liat status vaksin
- mau tau status vaksin
- bagaimana vaksinasi saya?
- vaksinasi saya sudah selesai?
- saya sudah vaksin atau belum?
- apa saya masih perlu vaksin?
- pengen tau perlu vaksin atau tidak
- saya udah vaksin blom?
- apakah saya sudah vaksinasi?
- intent: give_name
examples: |
- nama saya [Ucok](person_name)
- nama saya [wira](person_name)
- nama saya [agus](person_name)
- nama saya [budi](person_name)
- nama saya [acong](person_name)
- nama saya [sitorus](person_name)
- nama saya [situpea](person_name)
- intent: out_of_context
examples: |
- assalamualaikum
- okaerinasai
- ikimas
- woi bangsat
- ojamasimaaas
- anjing
- monyet
- kontol
- babi
- ngentot
stories.yml
version: "2.0"
stories:
- story: basic greetings
steps:
- intent: greet
- action: utter_greet
- story: selamat tinggal
steps:
- intent: goodbye
- action: utter_goodbye
- story: conversation_kagak_ngerti
steps:
- intent: out_of_context
- action: action_out_of_context
rules.yml
version: "2.0"
rules:
- rule: balas ucapan ABC user
steps:
- intent: nlu_fallback
- action: action_out_of_context
- rule: greet user
steps:
- intent: greet
- action: utter_greet
- rule: activate vaccination form
steps:
- intent: ask_status_vaccination
- action: vaccination_form
- active_loop: vaccination_form
- rule: Submit form
condition:
# Condition that form is active.
- active_loop: vaccination_form
steps:
- action: vaccination_form
- active_loop: null
- slot_was_set:
- requested_slot: null
# The action we want to run when the form is submitted.
- action: utter_thanks
actions.py
# This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/custom-actions
# This is a simple example for a custom action which utters "Hello World!"
from typing import Any, Text, Dict, List
from rasa_sdk.events import SlotSet
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormValidationAction
from rasa_sdk.events import EventType
from rasa_sdk.types import DomainDict
class ActionOutOfContext(Action):
def name(self) -> Text:
return "action_out_of_context"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
dispatcher.utter_message(text="Maaf, maksudnya apa ya?")
return []
class AskForPatientName(Action):
def name(self) -> Text:
return "action_ask_patient_name"
def run(
self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict
) -> List[EventType]:
dispatcher.utter_message(text="Boleh tau nama lengkap anda? silakan ketik nama anda :")
return []
class ValidateVaccinationForm(FormValidationAction):
def name(self) -> Text:
return "validate_vaccination_form"
def validate_patient_name(
self,
slot_value: Any,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: DomainDict,
) -> Dict[Text, Any]:
"""Validate patient_name."""
dispatcher.utter_message(text="VALIDATE NAMA" + slot_value)
return {"patient_name": "Pasien: " + slot_value}