Negative Expressions

How to exclude a keyword from an AI rule

Definition:
It is an Expression that excludes a keyword. Simply add a minus sign in front of the keyword you want to exclude.

Example:
“maison -marseille” is triggered when the entered sentence contains the keyword “maison” AND does not contain the word “marseille

This is a useful feature when you want to distinguish between two rules that might overlap.

Example:
In our real estate chatbot, we want to distinguish between requests for houses with pools and those without.

So we make two rules:

“House without swimming pool” Rule

“House with swimming pool” Rule

The problem here is that “house” is common to both rules. The AI will not know what to choose between the two rules at first. Then with our learning algorithms the AI will choose the most popular answer of the two (see paragraph on Machine Learning). But then you have a 50/50 chance of giving the wrong answer.

One way to solve this problem is to use a Negative Expression by excluding “pool” from the first rule.

“House without swimming pool” Rule

“House with swimming pool” Rule

When using a Negative Expression, it must be active on all keywords and phrases in a rule.

Example:
For our no-pool rule:


“House without swimming pool” Rule

We see here one of the limits of the Negative Expressions because if we have two rules with several keywords, we have to make all the combinations. Furthermore, our algorithms will not apply to negative keywords (for response time optimization purposes) and do not detect input errors on them.

Example:
For our rules on homes with and without pools:


“House without swimming pool” Rule

“House with swimming pool” Rule

We will see later on a more efficient way on Botnation to solve this kind of rule conflict with Priority Keywords.

Negative Expressions are therefore reserved for chatbots whose AI is not very complex.

In addition:
Keywords and Expressions
Exit keywords
All you need to know about NLP on Botnation

➜ Discover Botnation and launch your chatbot easily!