Change Threshold for Intent Matching
# 👀feature-requests
a
@agreeable-pizza-94949 has also asked this in other channels. I would like to change the threshold for when an intent matches, such that the AI Task can respond if an Intent does not match. Currently, intents with 68% confidence are matching because what is asked uses a term that is only in that intent, but the question is not actually related to the intent. Therefore, it never makes it to the AI Task that responds with AI info. I use nested workflows, and many intents, so it doesn't make sense to add an AI Task checking confidence (https://botpress.com/docs/cloud/toolbox/transition-to/#adding-an-always-transition) through a variable (if possible) after every intent, as managing that would be exhausting. A global threshold Intent Match Confidence score, perhaps in Bot Settings (or however you best see fit), so we can tune the matching of intents would be incredibly useful. 😀
c
interesting suggestion +1 Maybe there should be a "training" option "intents' that learns to differentiates between similar/overlapping intents.
a
+1 maybe add a threshold at the intent card level is the best way ? I tried also an expression card « if intent is my intent and confidence > x% but with no success
a
Any tuning ability would be nice. I have 100s of intents and use them through Global intents, not per card, for easier management, so a per intent card would be tedious for me. But any controls would be nice! 😀
f
Remember to upvote the post by reacting with the UP! Emoji Same for @agreeable-pizza-94949
a
@acceptable-kangaroo-64719 @bumpy-butcher-41910 I know this feature might not exist or be on the roadmap, but is there a way to mimic this behavior? Preferably without having to add it to/for every single 'Intent is' (if not global, maybe per workflow?). 😀
a
You could look into using hooks to evaluate confidence on every incoming message
a
Thanks, @acceptable-kangaroo-64719! For those wondering how, here's my poor JS attempt 😀 Hook: "After Incoming Message"
Copy code
workflow.intentMatched = false;

// Check if intents exists and has at least one item
if (event.nlu && event.nlu.intents && event.nlu.intents.length > 0) {
  const intentConfidence = event.nlu.intents[0].confidence;

  if (intentConfidence > 0.75) {
    workflow.intentMatched = true;
  }
Then at the start of my Main workflow, if intentMatched is True, it goes into the prepared responses. If not, it directs to an AI Task that can answer questions, guard-railed to the company domain of knowledge. 😀 @agreeable-pizza-94949 It looks like you could do the same thing, but in an Execute Code card, which could give you the flexibility to do it in a sub-workflow or even per-intent.
23 Views