Skip to content

Using Specific Intents for recognition

0

Hi Team,

I’m facing a scenario where I could use some guidance from the community.

I have an intent called “Booking”, and during the confirmation phase, I ask the user: “Can I proceed with the booking?” The user response could match one of four intents: YES, NO, REPEAT, or MAIN MENU.

Additionally, I need to handle no-input and no-match cases with custom retry prompts.

Initially, I considered using input and output contexts to restrict intent recognition. However, since these four intents are shared across other parent intents as well, context scoping won’t work effectively in this case.

What would be the best way to handle this kind of conditional intent restriction and fallback? If anyone has faced a similar scenario, your insights would be greatly appreciated.

2 Answers
0

At the end of an intent, if you want to confirm that the customer wants to proceed with a booking, I would recommend that you do not switch intents, instead use a slot to determine if they want to continue or not. If they choose to continue you fulfill the intent with a lambda.

You can create a custom slot that can handle yes/no/repeat/main menu (or if you only ned yes/no, then you can use the built in confirmation slot type) At the end of the intent you elicit for this slot and route based on the response

To create separate prompts from no-input vs no-match you will have to use lambda. Check the inout transcript. If it is empty you have a no-input. If it contains input, but the slot does not contain a resolved value, then you have a no-match

AWS
answered a year ago
  • Thanks for your response. I have a question regarding the use of the slot-based approach. Suppose I have a custom slot with the value "Yes" and multiple synonyms mapped to it. For instance, in response to the question “Can I proceed with the booking?”, a user might say something like “please do the booking,” which should ideally be interpreted as “Yes.”

    Is it considered good practice to include longer phrases—say, 4 to 5 words—as synonyms in the slot definition? Or is there a better approach to handle such responses?

0

To handle your scenario effectively, you can use a combination of intent confidence scores and a fallback intent in Amazon Lex. Here's an approach you can consider:

  1. Define specific intents: Create separate intents for YES, NO, REPEAT, and MAIN MENU with clear, distinct utterances for each.

  2. Use confidence scores: Amazon Lex V2 provides confidence scores for intents. You can compare these scores to determine the most likely intent when the user responds. For example, if the YES intent has a significantly higher confidence score than the others, you can proceed with the booking.

  3. Implement a fallback intent: Add an AMAZON.FallbackIntent to your bot. This will be triggered when Lex can't confidently match the user's input to any of your defined intents.

  4. Custom Lambda function: Use a Lambda function as a dialog code hook to handle the logic for intent selection and fallback scenarios. In this function, you can:

  • Check the confidence scores of the recognized intents
  • Implement custom logic to choose the appropriate intent based on the context of the conversation
  • Handle no-input and no-match cases by checking for the fallback intent
  1. Retry prompts: In your Lambda function, keep track of the number of retry attempts for no-input and no-match cases. You can use session attributes to store this information. Based on the retry count, you can provide custom prompts or take appropriate actions (like transferring to a human agent).

  2. Clarification prompts: Configure clarification prompts in your Lex bot to handle ambiguous inputs. These prompts will be used when Lex can't confidently determine the user's intent.

By combining these techniques, you can create a more controlled flow for intent recognition in your specific confirmation scenario, while still maintaining flexibility for these intents to be used in other parts of your bot. This approach allows you to handle the conditional intent restriction and fallback cases effectively without relying solely on context scoping.
Sources
AMAZON.FallbackIntent - Amazon Lex V1
Using intent confidence scores to improve intent selection with Lex V2 - Amazon Lex

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.