We are currently using a Response Selector to use FAQs for our bot, but we have an issue where the user said a message and Rasa matches the message with the intent faq, but when I look the confidence in the ranking of the FAQs is below 0.3, how can we add a fallback that checks the confidence level of the actual FAQ that it’s being selected and not only the intent itself? Do we have to use an out-of-scope intent?
Thank you and let me know if you need more information
@dakshvar22 Yes, sure. I’ll do it. We created a custom response selector based on the default ResponseSelector to check for confidence inside the selector.
@ali.karimi I didn’t create a feature request, my bad.
We created a custom component that extends the regular ResponseSelector. We override the process function and we use the same thing as the base code that you can find on their source code, and then, at the end of the code, we added validation for the top_label confidence key and if it was lower than our set threshold, we changed the confidence of that given FAQ.
I don’t have access to the code now, but this is the main idea.
I have the same issue for an FAQ bot use case. @dakshvar22 Is there a plan for implementing this feature?
@ali.karimi@DanielOlarte I really appreciate all the input here and issue. We will not be able to fit this on the roadmap before the end of 2021 and are still figuring out what problems we plan to solve in 2022, so we do not have plans to solve this problem yet
Hi everyone! Faced same problem and with the help of an advice from @DanielOlarte I did extend ResponseSelector class and it works.
For those who wanted to see some snipped(as myself):
in custom_component.py created class CustomResponseSelector extension of class ResponseSelector(which is here)
did overwrite process function - just added these lines at the end, replacing FAQ intent confidence with its value from response selector, applied only if FAQ intent was predicted from intent classfier:
predicted_intent = message.get(INTENT)
if predicted_intent and predicted_intent["name"] == selector_key:
predicted_intent["confidence"] = top_label[PREDICTED_CONFIDENCE_KEY]```