Entity with character sequence makes classification fail


I’m working on a bot which asks for a Belgian enterprise number through a form. An example of this is BE0123456789.

I’ve created a regex that matches and a few of these examples have been added to my NLU data, all under the inform intent.

## regex:enterprise_number
- [bB][eE][0-1][0-9]{9}

However, some combinations seem to match other intents, like greet and goodbye. Even though the entity enterprise_number is never added as an example to these intents. Note: the entity is extracted even when the intent is wrong.

If I add a lot more examples of this pattern to the inform intent, I fail to interpret “bye” as a goodbye etc.

How could I improve the intent classification?

Hello @TomVanWemmel,

That happens to me too, and it seems like there is no real solution to this. But if you only need to fill the slot value in the form, then as long as the entity is extracted i think it should be fine (cause i don’t think the wrong intent interferes with the form). Outside of form action, you can increase the fallback threshold a little bit so if the user randomly enter those, they will receive a fallback utter. That’s what i did.

What are some of the examples that trigger other intents? Just examples of the regex? If it happens together with other words in the message eg “Hi my number is be0123456789” you could use the multiple intents feature here Choosing a Pipeline.

The input only contains those enterprise numbers without anything else.

I ended up with the following in my slot_mapping

"enterprise_number": [
                entity="enterprise_number", not_intent="ask_explanation"

Originally I only accepted entities that were extracted from “inform” intents. Now I’m accepting everything except when the user asks information about this entity. Because I wanted to anticipate that users might have typo’s, I accept the literal text, in order to validate it in another function.