Using keyword filters for more accurate answers and customizing “don’t know” answers - QnABot on AWS

Using keyword filters for more accurate answers and customizing “don’t know” answers

Keyword filters

The keyword filter feature helps the solution to be more accurate when answering questions via Amazon OpenSearch Service, and to admit more readily when it doesn’t know the answer.

The keyword filter feature works by using Amazon Comprehend to determine the part of speech that applies to each word you say to QnABot on AWS. By default, nouns (including proper nouns), verbs, and interjections are used as keywords. Any answer returned by QnABot on AWS must have questions that match these keywords, using the following (default) rule:

  • If there are one or two keywords, then all keywords must match.

  • If there are three or more keywords, then 75% of the keywords must match.

If you have selected a non-English language for your deployment, then it will use Amazon Translate to translate these keywords back to the language your user is using for interaction. If QnABot on AWS can’t find any answers that match these keyword filter rules, then it will admit that it doesn’t know the answer rather than guessing an answer that doesn’t match the keywords. The solution logs every question that it can’t answer so you can see them in the Kibana Dashboard.

Custom “Don’t Know” answers

When QnABot on AWS can’t find an answer, by default you’ll see or hear the response, “You stumped me! Sadly, I don’t know how to answer your question”. You can customize this answer by creating a new item in content designer, called the no_hits item by following these steps:

  1. From the content designer, choose ADD to create a new item:

    • Enter ID: CustomNoMatches

    • Enter question: no_hits

    • Enter answer: Terribly sorry, but I don’t know that one. Ask me another.

  2. Choose CREATE to save the item.

  3. Use the web UI to ask: What are Echo Buds?