aws-solutions / qnabot-on-aws

AWS QnABot is a multi-channel, multi-language conversational interface (chatbot) that responds to your customer's questions, answers, and feedback. The solution allows you to deploy a fully functional chatbot across multiple channels including chat, voice, SMS and Amazon Alexa.
https://aws.amazon.com/solutions/implementations/aws-qnabot
Apache License 2.0
401 stars 253 forks source link

Score matching #730

Closed dangollayan closed 6 months ago

dangollayan commented 6 months ago

Hi devs!

Is there a way to control the threshold of score? For example, I would like to only proceed to specific QID when the score is above 20 image

fhoueto-amz commented 6 months ago

Please refer to the implementation guide at https://docs.aws.amazon.com/solutions/latest/qnabot-on-aws/ More specifically check the section https://docs.aws.amazon.com/solutions/latest/qnabot-on-aws/modifying-configuration-settings.html with the ES_MINIMUM_SHOULD_MATCH parameter.

bobpskier commented 6 months ago

@dangollayan I believe score as determined by opensearch is only relative to the other qids identified in the current search. Its not a percentage or anything that can be compared between different searches. Hence there is no mechanism to configure a minimum score result. If keyword matching is enabled, the setting referenced by @fhoueto-amz could be used to control the minimum number of keyword matches required.

abhirpat commented 2 months ago

@dangollayan You can control the score thresholds when you using embeddings through settings EMBEDDINGS_SCORE_THRESHOLD, EMBEDDINGS_SCORE_ANSWER_THRESHOLD, and EMBEDDINGS_TEXT_PASSAGE_SCORE_THRESHOLD settings.

For more information, please Semantic question matching using text embeddings