I have a slot reminder_subject. This slot accept any random text as user input. I want bot to treat this user message as a value.
Is there any way to define type for this slot as Free text in domain.yml.
I have read FormAction but not getting clarity how to implement this use case
My story for this looks like this -
set_reminder
utter_what_reminder_for
set_reminder{“reminder_subject”: “movie with family”}
I did the same way… but for this text wrong intent is predicted and so the flow is breaking.
This reminder text should not belong to any intent because this is random text that user can ask bot to remind later.
You should have a generic intent called /inform where all this information goes. However, we’re also working on a new verison of the form action where you’ll be able to input free text without paying much attention to the intent. we’ll be merging this in the next few weeks
Now, I have implemented /inform intent for routing random text to this intent.
sometimes random text is recognised as reminder_subject and sometimes it is not recognised. How do I make sure that reminder_subject is always detected?
Here, reminder_subject is the random text that user want bot remind later.
You can try running the NLU evaluate script and see what intents are getting confused. But a more general solution will be provided with these new forms i described above
How can I prepend text like “to” with tracker.latest_message.get(‘text’) in rasa or
Before hitting the api, I want to prepend text with as per requested slots to input text
@akelad is the form action(in current version of rasa-core) capable of taking free text as slot values for requested slot (incase the intent is detected as inform) or any text.
from_text() doesn’t see to be pulling the freetext input of the user after activation of requeststatus_form, do you know what could be the issue?
class IncStatus(FormAction):
"""Check INC Status FormAction"""
def name(self):
"""Unique identifier of the form"""
return "requeststatus_form"
@staticmethod
def required_slots(tracker: Tracker) -> List[Text]:
"""A list of required slots that the form has to fill"""
return ["requestnum"]
def slot_mappings(self):
# type: () -> Dict[Text: Union[Dict, List[Dict]]]
"""A dictionary to map required slots to
- an extracted entity
- intent: value pairs
- a whole message
or a list of them, where a first match will be picked"""
return {"requestnum": [self.from_text()]}
def submit(self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict]:
"""Define what the form has to do
after all required slots are filled"""
# utter submit template
dispatcher.utter_template('utter_request_status', tracker)
return []
actions:
- utter_goodbye
- utter_greet
- utter_thanks
- utter_ask_inc
- utter_request_status
entities:
- request
- requestnum
forms:
- requeststatus_form
intents:
- request_status:
use_entities: false
- greet
- inform
- goodbye
- thanks
slots:
inc:
auto_fill: false
type: unfeaturized
request:
type: text
requested_slot:
type: unfeaturized
templates:
utter_ask_requestnum:
- text: Please provide the incident number in this format (INC000012345678)
utter_goodbye:
- text: Talk to you later!
- text: See ya!
- text: Bye!
utter_greet:
- buttons:
- payload: Status of Request
title: Status of Request
text: "Hey there! Hope you're having a great day, what help do you need today?\
\ You can pick from the below options:"
utter_request_status:
- text: You are trying to check request status of {requestnum}
utter_thanks:
- text: My pleasure.
- text: No Worries!
- text: Happy to help :)
- text: Anytime!
- text: You are welcome!
+1, facing the similar kind of issue. Though am using master from git for rasa-core, instead of taking the user input as it is, nlu is being called. Explained here.