What's the right way to handle multiline single intents?


(Yoandy Mesa) #1

For example:

  • user: Hi
  • bot: Hello!
  • user: i want to know the status of my order
  • user: is it dispatched already?
  • user: order number 3467123

i dont want the bot says 3 times:

  • your order is in status: xyz.

neither:

  • what’s your order number?
  • what’s your order number?
  • your order is in status: xyz.

i would like it just say:

  • your order is in status: xyz.

or maybe:

  • what’s your order number?
  • your order is in status: xyz.

I’m already using fallback intent to offer handoff conversation to live agent, but i think in a case like this its not necessary to offer handover.

What is the right / rasa way to handle this?

Thanks in advance, Yoandy


(Akela Drissner) #2

I’m not sure I understand your question. the bot will likely respond to the user before he can write three messages


(Nicole Pilsworth) #3

I am facing the same challenge at the minute, since people have a tendency to split long messages into several messages, even if there is only one intent. The bot responds to each message separately, but it would be ideal if the bot could interpret these 3 messages as only one.

The way I have been trying to tackle this is to use my front end to detect if the user is still typing, and if they are, then do not dispatch the message to Rasa yet. Instead, set a timeout for 2 seconds after the user has finished typing, and collate all messages into one comma separated sentence.

In your example, if there was a less than 2 second delay of typing between the messages, these would be the messages exchanged between Rasa and the front end:

  • user: Hi
  • bot: Hello!
  • user: i want to know the status of my order, is it dispatched already?, order number is 3467123

And then the response would be only one ‘your order is in status: xyz’.

Apart from this, I’m not sure how else to handle multi-line messages that contain one single intent. I would appreciate any thoughts/suggestions as well.