Exclude specific single-word input from triggering a class

Hi, Teneo Developers Community!

Please help me solve this puzzle.
I have built a Class in our Swedish solution that contains loads of ways a customer can ask for product availability (it includes 735 training examples).
The product flow tied to this Class gets triggered perfectly fine until the customer (aka me as it is not published yet) only types in a city name that has the part of the word ‘‘köp’’ (purchase) in it, e.g.
The flow gets triggered even though the customer didn’t type in anything else (and the Class doesn’t have examples of only city names in it).
However, city names are important - I don’t want to exclude this flow from triggering if the customer mentions any of cities with ‘‘köp’’ in the name. I just want it not to get triggered if the city is the only thing that was in the input.

I tried using !%LINKÖPING.NN.LEX as the only condition for this class-based flow and allow the 0 unused words limit to test one city, Linköping. As a result, this flow didn’t work at all.

How can I combine operators so that they don’t allow this flow to get triggered if the customer only types in a city name with köp in the name, and at the same time allow the flow to get triggered if the same city is mentioned in a sentence that corresponds to the Class-trained sentence structure?
That is:
Don’t trigger this flow if Enköping, Falköping, Jönköping, Köping, Lidköping, Linköping, Malmköping, Norrköping, Nyköping, Söderköping is the only thing in the input.
Do let input containing city names get triggered if they are in a sentence relevant to the Class contents - Kan jag köpa färska blommor i Jönköping? Har ni covid tester på er butik i Enköping? Säljer ni kattmat i Malmköping? Köpa bingo biljetter i Falköping, etc.

Tusen tack på förhand!

Best regards,

1 Like

Hi @Baiba,

using the Hybrid Approach seems to be a good idea here, only issue in your example is the setting of the 0 as unused words - which makes it fail to trigger.
I’ve tried it with the below Condition, with PURCHASE_IN_SWEDEN being here the name of my Class:


I’ve excluded here then the cases in which only a Swedish city name is sent as user input. You could also create your own customized list of city names if required, but I think in your example the preexisting list should work fine. The %WD_1.SCRIPT language object references user inputs with exactly one input word.
So that Condition seems to fulfill your criteria - let me know if it works for you :slight_smile:


1 Like

Hi Benjamin!

Ah yes, thanks to you! Worked like a charm!
Right, I don’t even need to specify the ‘köp’ part - it is enough by and-not’ing single city name inputs. Perfect!

And thank you again for the superfast response!

Best regards,

1 Like