Need help in creating FAQ from Button Payload :-)

Dear Team,

Could you please help me creating FAQ while i trigger the intent as a payload button.

I have a button(Question related to Document Lake) with the payload, /faq.

I have created an intent with the name “faq”, this is just to achieve the flow when user clicks on the button.

Now i have to ask the user Please provide your queries…?

When user provide his/her query, i want to render the response from the utter_faq from my domain(designed all the utterance for FAQ’s in my domain.yml). This is very clear

But, how do i handle when the cases like above said, when ever user clicks on the button with /faq payload, first thing is that i want to ask the user to provide his/her queries…

If i use stories, then it should be like this…

###Story for faq happy path

  • story: faq happy path steps:
    • intent: faq
    • action: utter_ask_questions
    • intent: faq
    • action: utter_faq
    • action: utter_did_that_help
    • intent: affirm
    • action: utter_anything_else
    • intent: affirm
    • action: action_user_world

###Story for faq happy path1

  • story: faq happy path steps:
    • intent: faq
    • action: utter_ask_questions
    • intent: faq
    • action: utter_faq
    • action: utter_did_that_help
    • intent: affirm
    • action: utter_anything_else
    • intent: deny
    • action: utter_welcome

###Story for faq sad path1

  • story: faq sad path steps:
    • intent: faq
    • action: utter_ask_questions
    • intent: faq
    • action: utter_faq
    • action: utter_did_that_help
    • intent: deny
    • action: utter_ask_extquery
    • intent: affirm
    • action: action_user_world

###Story for faq sad path2

  • story: faq sad path steps:
    • intent: faq
    • action: utter_ask_questions
    • intent: faq
    • action: utter_faq
    • action: utter_did_that_help
    • intent: deny
    • action: utter_ask_extquery
    • intent: deny
    • action: utter_welcome

If i use rules, then it should be like this… unfortunately rules can’t work for my design, as i have many steps(utter_did_that_help and utter_anything_else) as soon as the bot respond back for particular faq with a response.

If user says No for the utterance “Utter_did_that_help” then i have to create a ticket along with the user message. I have achieved this as well.

- rule: respond to faq
    steps:
      - intent: faq
      - action: utter_faq

crazy thing is that i can’t use both stories and rules together with the same intents and it will not compile for sure as it is going to contradict each other.

So, in this case i have to compromise my design and my manager will not agree for that :joy:

What should i do to achieve this flow exactly…Please help. Thanks a ton in advance

Best Regards, Ravi

I’m not sure I understood your problem but I’ll try:

Can you change this

- story: xxx
  - intent: faq
  - action: utter_ask_questions

to this?

- story: xxx
  - intent: ask_faq
  - action: utter_ask_questions

Keep the faq/* intents for the utter_faq/* responses only.

Okay @ChrisRahme let me try this way.

Hi @ChrisRahme I have changed code as suggested.

It didn’t helped.

Here bot should ask the user to ask his/her questions…

As soon as user sends his question bot should respond…with an answer.

Thanks

Best Regards, Ravi

If you try this in Rasa X or Rasa Shell, do you see any error in the logs?

No @ChrisRahme i do not see any errors.

On Rasa X, do you see the intent predicted correctly? What’s the confidence?

Hi @ChrisRahme How do i check the confidence… Where can i see that… Is there any command for that?

It’s all written on the Rasa X interface under each message in this format:

intent/action (confidence)

Okay, i think i didn’t see this as i’m continuously working with my bot UI which i was designed.

More over, i am using RASA Open Source.

Haven’t install RASA X yet…

Hey @ChrisRahme

Time being i’ve fixed it by triggering “- action: action_restart” each time while the story ends. But this clearly slow down my bot performance. Thanks for your inputs :slight_smile:

Best Regards, Ravi

1 Like

That’s weird! How would a restart fix it?

Anyway, better than nothing! Maybe we will find a solution later :slight_smile:

By the way, on top of this, try adding a rule like so:

- rule: reply to faq
  - intent: faq
  - action: utter_faq
1 Like

Haha…

My manager was behind me and i was unable to escape…:- :joy:

Luckily i’ve applied that default RASA action “- action: action_restart” and it worked.

1 Like

Okay, will try for sure.

Why i am not interested in rules is just because of upcoming utterances after the bot response, like is there anything else? and did that help?

Any how, if we have more than one message when we use rules, then it is not possible to compile. Correct me if i’m wrong. Thanks

A rule such as

- rule: reply to faq
  - intent: faq
  - action: utter_faq

will tell the bot that faq should always be followed by utter_faq, which should be the case. This is why I suggested creating a separate intent ask_faq here.

I your case, if use the rule above, you will get an error saying that it predicts action_listen while your stories predict utter_did_that_help (I just realized it!).

But seeing in your stories, utter_faq is always followed by utter_did_that_help, and then an intent (so action_listen). Therefore you can write this rule:

- rule: reply to faq
  - intent: faq
  - action: utter_faq
  - action: utter_did_that_help

There should be no conflicts here.

Okay understood.

Also if you observe my stories closely, there are another scenarios like…

utter_anything_else followed by utter_did_that_help

and based on the payload Yes or No, we are asking the user to provide his feedback and responding him/her back with a ticket id.

after this we are asking the user again “utter_anything_else”.

Soon i will modify this entire “Solr_Document_Search_Project” code with personal search algorithms and showcase it on RASA Forum. Thanks

Best Regards, Ravi

1 Like