{"id":2912,"date":"2023-01-18T16:56:55","date_gmt":"2023-01-18T15:56:55","guid":{"rendered":"https:\/\/botnation.ai\/negative-expressions\/"},"modified":"2026-01-02T15:27:59","modified_gmt":"2026-01-02T14:27:59","slug":"negative-expressions","status":"publish","type":"support","link":"https:\/\/botnation.ai\/en\/support\/negative-expressions\/","title":{"rendered":"Negative Expressions"},"content":{"rendered":"<p>How to exclude a keyword from an AI rule<\/p>\n\n\n\n<p><strong>Definition:<\/strong><br>It is an Expression that excludes a keyword. Simply add a minus sign in front of the keyword you want to exclude.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong><em>Example:<\/em><\/strong><em><\/em><br><em>\u201cmaison -marseille\u201d is triggered when the entered sentence\u00a0<strong>contains<\/strong>\u00a0the keyword \u201cmaison\u201d\u00a0<strong>AND does not contain<\/strong>\u00a0the word \u201cmarseille<\/em><\/p>\n<\/blockquote>\n\n\n\n<p>This is a useful feature when you want to distinguish between two rules that might overlap.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong><em>Example:<\/em><\/strong><em><\/em><br><em>In our real estate chatbot, we want to distinguish between requests for houses with pools and those without.<\/em><\/p>\n\n\n\n<p><em>So we make two rules:<\/em><\/p>\n\n\n\n<p><em><strong>\u201cHouse without swimming pool\u201d Rule<\/strong><\/em><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/01\/image-15.png.webp\" alt=\"\" class=\"wp-image-2656\"><\/figure>\n\n\n\n<p><em><strong>\u201cHouse with swimming pool\u201d Rule<\/strong><\/em><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/01\/image-16.png.webp\" alt=\"\" class=\"wp-image-2658\"><\/figure>\n\n\n\n<p><em>The problem here is that \u201chouse\u201d 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.<\/em><\/p>\n\n\n\n<p><em>One way to solve this problem is to use a Negative Expression by excluding \u201cpool\u201d from the first rule.<\/em><\/p>\n\n\n\n<p><em><strong>\u201cHouse without swimming pool\u201d Rule<\/strong><\/em><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/01\/image-17.png.webp\" alt=\"\" class=\"wp-image-2660\"><\/figure>\n\n\n\n<p><em><strong>\u201cHouse with swimming pool\u201d Rule<\/strong><\/em><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/01\/image-18.png.webp\" alt=\"\" class=\"wp-image-2662\"><\/figure>\n<\/blockquote>\n\n\n\n<p>When using a Negative Expression, it must be active on all keywords and phrases in a rule.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong><em>Example:<\/em><\/strong><em><\/em><br><em>For our no-pool rule:<\/em><\/p>\n\n\n\n<p><br><em><strong>\u201cHouse without swimming pool\u201d Rule<\/strong><\/em><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/01\/image-19.png.webp\" alt=\"\" class=\"wp-image-2664\"><\/figure>\n<\/blockquote>\n\n\n\n<p>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.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong><em>Example:<\/em><\/strong><em><\/em><br><em>For our rules on homes with and without pools:<\/em><\/p>\n\n\n\n<p><br><em><strong>\u201cHouse without swimming pool\u201d Rule<\/strong><\/em><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/01\/image-20.png.webp\" alt=\"\" class=\"wp-image-2666\"><\/figure>\n\n\n\n<p><em><strong>\u201cHouse with swimming pool\u201d Rule<\/strong><\/em><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2023\/01\/image-21.png.webp\" alt=\"\" class=\"wp-image-2668\"><\/figure>\n<\/blockquote>\n\n\n\n<p>We will see later on a more efficient way on Botnation to solve this kind of rule conflict with Priority Keywords.<\/p>\n\n\n\n<p>Negative Expressions are therefore reserved for chatbots whose AI is not very complex.<\/p>\n\n\n\n<p><strong>In addition:<\/strong><br>\u2013 <a href=\"https:\/\/botnation.ai\/en\/keywords-and-expressions\/\">Keywords and Expressions<\/a><br>\u2013<a href=\"https:\/\/botnation.ai\/en\/exit-keywords-in-nlp-or-priority-keywords\/\"> <\/a><a href=\"https:\/\/botnation.ai\/en\/exit-keywords-in-nlp-or-priority-keywords\/\">Exit keywords<\/a><br>\u2013 <a href=\"https:\/\/botnation.ai\/en\/all-you-need-to-know-about-artificial-intelligence-on-botnation-table-of-contents\/\">All you need to know about NLP on Botnation<\/a><\/p>\n\n\n","protected":false},"featured_media":0,"template":"","meta":{"_acf_changed":false},"categorie-support":[194,198,221],"class_list":["post-2912","support","type-support","status-publish","hentry","categorie-support-features","categorie-support-tutorials","categorie-support-web-chatbot-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/support\/2912","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/support"}],"about":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/types\/support"}],"wp:attachment":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/media?parent=2912"}],"wp:term":[{"taxonomy":"categorie-support","embeddable":true,"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/categorie-support?post=2912"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}