Free Form Text without Slots and Intent Prediction - Getting Started with Rasa / Tutorials, Resources & Videos - Rasa Community Forum
👋 Introducing the Rasa Playground
Free Form Text without Slots and Intent Prediction
post by mishra-atul5001 on Jun 11, 2020
Hey Everyone,
I am trying to implement a functionality in my bot which sends a mail when a particular intent is hitted. Currently I can send the mail using Shell Script and Python Connection, but the mail is totally static, i.e. some predefined mail format with fixed Subject,Body. Our intention is that when the particular mailing_intent is predicted, the user should get the feasibility of writing a free text which is independent of any intent prediction and that is captured using tracker.latest_message[‘text’] and can be used in the body of the mail.
Right now, we can pass the latest message of the mailing intent but I have no idea as how to fetch the free flow text which is independent of any intent prediction
Anyone can help me on this?
@akelad , I went through free text type, but couldn’t find it helpful in my case.
Please note: I am not using any entities or slots, just normal intent hitting and then required to get a free flow text.
post by saurabh-m523 on Jun 12, 2020
Hi @mishra-atul5001!
You can use Forms to get free text input. Although a form will fill a slot with the free text input, but I guess that should not be a problem (?).
You can trigger this form on receiving the mail intent, ask the user for free text, and then finally in the submit() method of the form you can send the email.
Hope that helps.
post by mishra-atul5001 on Jun 12, 2020
@saurabh-m523, I get it what you’re trying to say!. But just one clarification I need is that the slot which will be captured has to be defined in nlu file. Without defining the slot, it won’t work. In that case, we have to fill up the slot values with some random data. But free text can go out of the section also. Or is it possible that we do not define any intent with respect to that slot, and just mention it in domain.yml file and while defining the form, catch an undefined empty slot?
If you have any example regarding this, it would be helpful!!
post by saurabh-m523 on Jun 12, 2020
No need to mention the slot in NLU. Actually NLU does not have slots at all, they are called entities. Slots can be of the same name as entities and are defined in domain.yml file.
So, you can just define an unfeaturized slot in the domain.yml and then fill this slot in your FormAction.
post by mishra-atul5001 on Jun 12, 2020
Awesome. Loved the response. Will try it today and let everyone know about the same!
post by mishra-atul5001 on Jun 15, 2020
Done
post by saurabh-m523 on Jun 15, 2020
Hi @mishra-atul5001!
You want free text input right?
So you should use slot mappings. From the docs:
self.from_text(intent=intent_name)will use the next user utterance to fill the text slotslot_nameregardless of user intent ifintent_nameisNoneelse only if user intent isintent_name
post by AnandS on Jun 20, 2020
Hi @mishra-atul5001, did you get this working , I have the same problem and unable to find a solution. Please let me know if find a fix.