v12 icon indicating copy to clipboard operation
v12 copied to clipboard

NLU: Slot filling not using entity regex

Open coatesap opened this issue 2 years ago • 0 comments

When you have an utterance that uses a slot that is linked to an entity using a regex, the regex is seemingly ignored for the purposes of slot filling.

To Reproduce

  1. Create an entity called job with the regex ^\s*([a-zA-Z-']+\s*){1,3}$ (any 1 - 3 words)
  2. Create an intent called job_pay, with an utterance like how much do vets get paid and tag vets as a slot linked to the job entity
  3. Train the bot and try a phrase like how much do train drivers get paid. The slot will be incorrectly filled with train, even though we've specified our slot can contain 1 - 3 words

Note: To reproduce, you'll need to add an extra 2 related utterances in order for NLU to kick in (see screenshot below for suitable examples)

botpress-nlu-intent

The same probably also exists when using 2 words in the utterance, and 1 word in the message to the bot, except the slot won't be filled at all.

Expected behavior The NLU slot filling should take the entity regex into account, and not make us repeat the same utterance 3 times to allow 1 - 3 words in the slot.

coatesap avatar Mar 17 '22 11:03 coatesap