This article will explain one of the most important part of SecondEGOPatterns tab. In this tab we will prepare instructions for chatbot to detect what visitor is asking. If we understand the question, then chatbot can response with right answer. And chatbot conversation is just about that.
Article is a little longer, but it is worth to read and understand it.

Pattern Basics
Let’s look what pattern looks like.

1. Label – a unique pattern name that can be modified
2. Pattern group – the group the selected pattern is assigned to (setting up groups improves pattern organization)
3. Keywords and phrases – strings used for match verification with the user’s questions
4. AND/NOT operators – operators used for advanced match verification
5. Basic responses – all available answers to the user’s question
6. Additional responses – additional actions that can be added to the answer

Identifying the questions

1. Keywords

The condition (i.e. the pattern matching the user’s question) is met if the user’s question to the chatbot contains any of the listed words. An OR operator applies between the listed keywords. In other words, the user’s question needs to contain at least one of them. In addition, word phrases can be used instead of one-word keywords.

Examples:

“Is your sports car blue?” – true
“Does Simon have a bicycletrue
“A sports car, a dog or a bicycle?” – true
“Do you have a dog?” – true
“Do you have a sports bicycle and a car?” – true

“Do you have a fast car?” – false

2. Whole Sentences
The condition (i.e. the pattern matching the user’s question) is met if the user’s question to the chatbot contains any of the listed sentences. An OR operator applies between the listed sentences. In other words, the user’s question needs to contain at least one of them. The matching process is case-insensitive.
Examples:

what is the capital city of france” – true
What is the capital city of France?” – true
“do you know any capital city” – false
“the capital city of france” – false
“I wonder…what is the capital city of france today?” – true

3. Advanced match verification
If an AND operator is specified, the user’s question needs to contain at least one keyword or word phrase from each row. OR operators still apply within each row.
Examples:

where is bigben” – false
where is bigben located” – true
where is big ben located” – true
“where bigben is” – false
“where bigben is located” – false
4. Punctation marks
If the matching keyword, phrase or sentence in the pattern contains no punctuation mark, the condition (i.e. the pattern matching the user’s question) will be met regardless of the user’s question containing any punctuation marks.
Examples:

where is italy” – true
Where is Italy” – true
where is italy?” – true
Where is Italy?” – true
However, if the matching keyword, phrase or sentence from the pattern contains a punctuation mark, the condition will only be met if the user’s question contains an identical mark in the same spot.
Examples:

“where is italy” – false
“Where is Italy” – false
where is italy?” – true
Where is Italy?” – true


Responding to the questions

1. Basic responses
When the pattern matches the user’s question, a randomly selected answer from the ones listed in that same pattern is automatically displayed to the user.
It is possible to apply bold and/or italic text formatting to any portion of text that makes up the answer by adding the [B][/B] tag for bold and the [I][/I] tag for italic.
Example:

“[B]Big Ben[/B] is in [I]London[/I].”


Answers may also incorporate URLs. By clicking on the hyperlink, the webpage will open in a new tab.
Example:

To obtain the output
“Italy is in Europe.”,
type in the following line:
“[URL=”http://en.wikipedia.org/wiki/Italy”]Italy[/URL] is in Europe.”


Email addresses can also be used. When the user clicks on the link, their default Email client opens up.
Example:

If you want the output
“Our Email address is info@secondego.com.”,
type in the following line:
“Our Email address is [URL=mailto:info@secondego.com]info@secondego.com[/URL].”

2. Automatic webpage opening
If you want a webpage to open automatically with the answer, choose the “+opens URL” option and type in the address of the desired webpage.
If you choose the “automatically in the same tab in the same window” option, the webpage will automatically open in the currently active tab of the user’s web browser along with the chatbot’s answer.
If the “in a new tab when the user clicks on the link” option is selected, however, an active link to that webpage is added at the end of the chatbot’s answer. By clicking on the link, the user will be able to open the webpage in a new tab of their preferred web browser.   
3. Adding multiple choices to the response
Answers can include a list of multiple choices. The user selects one of the choices by either clicking on it or entering the corresponding number (e.g. 1) or the content (e.g. Paris).
The course of the conversation is determined by the selected choice and its corresponding pattern. By using this strategy, a guided conversation that is based upon a pre-defined sequence of patterns can be established with the user.
Here is how your chatbot looks after this:
4. Using another pattern’s response

The selected answer can be complemented by using answers from other patterns. In the example above , the user didn’t provide the correct answer. By using the previous pattern, we are again able to provide the user with the previous three choices. The method complements the three choice scenario demonstrated in the previous example perfectly. 
This is the most complex tab in SecondEGO dashboard. If you carefully read this and understand it, everything will be much easier from now.
And don’t forget – if you have any question, you can send it to me and I will try to answer you. As I already did to some of blog followers. 

Leave a Reply