Node 1- User Intent utterances:
- getting timeout error
- timeout issue
- timeout error
Node 2- Entity(used button template js):
Option 1: ERROR: Timeout error 1
Option 2: ERROR: Timeout error 2
Option 3: ERROR: Timeout error 3
Node 3- Message(Switch case js)
if Option 1 - selected print(resolved error1)
elif Option 2- selected print(resolved error2)
elif Option 3- selected print(resolved error3)
Flow 1:
i) user writes getting timeout error
ii) user gets 3 error button
iii) user selects one of them and get corresponding answer
The above flow works fine and we are good with it.
Flow 2:
i) user writes ERROR: Timeout 1/2/3 directly to the chat window without mentioning natural language utterance like getting timeout error
ii) What we want from bot: we should get- direct answer based on ERROR mentioned
How to create the above 2 flows integrated in a single dialog task?
The simple solution here is to consider that the utterance:
ERROR: Timeout 1
is a command with a specific format/style. These kinds are command utterances are best trained via an FM pattern because is important that all elements are present and in that order.
So add an intent pattern to the initial dialog like:
< error : timeout
The <
means start of sentence and will anchor the rest of the pattern to that starting point. The platform will tokenize the colon to a distinct “word”, and you can decide whether to include that or not, or make it optional ( { : }
) - users are often imprecise with punctuation. The capitalized ERROR from the input will be converted to the lowercase canonical form.
By default the FM engine allows for a bit of flexibility and will match utterances that have a couple of extra words between each of the key (fundamental) words/tokens. You can disable that with the *0
token ( < error *0 : *0 timeout
) if you wish, at the risk of being more restrictive.