Condition issues with multiple sentences in one message

Dear Teneo experts,

How to make the bot read the whole message instead of just one of the sentences to collect the best condition match?
I have noted some recent customer conversation examples where dividing the text in two sentences changed what got triggered though the words in the message were exactly the same.

Here, it works great and the output is the correct one: I accidentally fueled gasoline instead of diesel with my mastercard, insurance? (Original in Swedish - Räkade tanka bensin istället för diesel med mitt master card, försäkring?)
But here, this triggers a more general output without the details on wrong product insurance: I accidentally fueled gasoline instead of diesel with my mastercard. insurance? (Swedish - Räkade tanka bensin istället för diesel med mitt master card. försäkring?)

Same goes for inputs that have a greeting phrase in the beginning. Sometimes though, with the same sentence and greeting structure, it looks past the greeting and scans the rest of the message as well but I have no clue why.
Example:
Hi. I would like to make a complaint. (Swedish - Hej. Jag önskar framföra ett klagomål.) Bot responds with ‘Hi, how can I help you?’ type of output and it should not be like that.
Hi I would like to make a complaint. (Swedish - Hej Jag önskar framföra ett klagomål.) Bot responds with ‘Sorry to hear about that. Let’s investigate what has happened.’ type of output and it is correct.

What to do about this issue?

I hope this makes sense. Looking forward to your reply!

Best regards,
Baiba

Hello Baiba,

Multiple sentences in a user input can indeed be a challenge to handle, and it is something you want to consider if your users tend to use multiple sentences in their inputs. The impact will however vary depending on the nature of the match requirements in your triggers and transitions.

If you use class match requirements, the issue will be less frequent as machine learning generally overlooks punctuation marks, and the class annotation will be based on the patterns in the entire input. Possibly, the classifier will return two or more classes, in which case you may want to decide which of the classes you want to use in your trigger matching process (see Multi-Intent Recognition and Handling for some ideas on how to handle this situation)

If your triggers and transitions make use of syntax Match Requirements, the issue may be of bigger impact. The Teneo Engine per default applies a “last to first” logic when evaluating the sentences in the input and it will stop testing when a match is found. Have a look at Sentence Test Order and Stop Testing for full details about the functionality.

The sentence test order can be modified, if you should wish to do so, although generally speaking, it will be the appropriate setting for Swedish and similar languages.

If the multiple sentences are causing issues for you, you could potentially remove punctuation marks from the user input with a regex in a global Pre-processing script, which would happen before the trigger matching process. As an example, s = s.replaceAll("\p{Punct}","") would remove all punctuation marks. This approach should be used with care though, as in some cases punctuation marks may be important for the meaning of the input.

I hope it helps.

Kind regards,
Britta

3 Likes