Saturday, December 14, 2024
No menu items!
HomeArtificial Intelligence and Machine LearningEnhance the caller experience with hints in Amazon Lex

Enhance the caller experience with hints in Amazon Lex

We understand speech input better if we have some background on the topic of conversation. Consider a customer service agent at an auto parts wholesaler helping with orders. If the agent knows that the customer is looking for tires, they’re more likely to recognize responses (for example, “Michelin”) on the phone. Agents often pick up such clues or hints based on their domain knowledge and access to business intelligence dashboards. Amazon Lex now supports a hints capability to enhance the recognition of relevant phrases in a conversation. You can programmatically provide phrases as hints during a live interaction to influence the transcription of spoken input. Better recognition drives efficient conversations, reduces agent handling time, and ultimately increases customer satisfaction.

In this post, we review the runtime hints capability and use it to implement verification of callers based on their mother’s maiden name.

Overview of the runtime hints capability

You can provide a list of phrases or words to help your bot with the transcription of speech input. You can use these hints with built-in slot types such as first and last names, street names, city, state, and country. You can also configure these for your custom slot types.

You can use the capability to transcribe names that may be difficult to pronounce or understand. For example, in the following sample conversation, we use it to transcribe the name “Loreck.”

Conversation 1

IVR: Welcome to ACME bank. How can I help you today?

Caller: I want to check my account balance.

IVR: Sure. Which account should I pull up?

Caller: Checking

IVR: What is the account number?

Caller: 1111 2222 3333 4444

IVR: For verification purposes, what is your mother’s maiden name?

Caller: Loreck

IVR: Thank you. The balance on your checking account is 123 dollars.

Words provided as hints are preferred over other similar words. For example, in the second sample conversation, the runtime hint (“Smythe”) is selected over a more common transcription (“Smith”).

Conversation 2

IVR: Welcome to ACME bank. How can I help you today?

Caller: I want to check my account balance.

IVR: Sure. Which account should I pull up?

Caller: Checking

IVR: What is the account number?

Caller: 5555 6666 7777 8888

IVR: For verification purposes, what is your mother’s maiden name?

Caller: Smythe

IVR: Thank you. The balance on your checking account is 456 dollars.

If the name doesn’t match the runtime hint, you can fail the verification and route the call to an agent.

Conversation 3

IVR: Welcome to ACME bank. How can I help you today?

Caller: I want to check my account balance.

IVR: Sure. Which account should I pull up?

Caller: Savings

IVR: What is the account number?

Caller: 5555 6666 7777 8888

IVR: For verification purposes, what is your mother’s maiden name?

Caller: Jane

IVR: There is an issue with your account. For support, you will be forwarded to an agent.

Solution overview

Let’s review the overall architecture for the solution (see the following diagram):

We use an Amazon Lex bot integrated with an Amazon Connect contact flow to deliver the conversational experience.
We use a dialog codehook in the Amazon Lex bot to invoke an AWS Lambda function that provides the runtime hint at the previous turn of the conversation.
For the purposes of this post, the mother’s maiden name data used for authentication is stored in an Amazon DynamoDB table.
After the caller is authenticated, the control is passed to the bot to perform transactions (for example, check balance)

In addition to the Lambda function, you can also send runtime hints to Amazon Lex V2 using the PutSession, RecognizeText, RecognizeUtterance, or StartConversation operations. The runtime hints can be set at any point in the conversation and are persisted at every turn until cleared.

Deploy the sample Amazon Lex bot

To create the sample bot and configure the runtime phrase hints, perform the following steps. This creates an Amazon Lex bot called BankingBot, and one slot type (accountNumber).

Download the Amazon Lex bot.
On the Amazon Lex console, choose Actions, Import.
Choose the file BankingBot.zip that you downloaded, and choose Import.
Choose the bot BankingBot on the Amazon Lex console.
Choose the language English (GB).
Choose Build.
Download the supporting Lambda code.
On the Lambda console, create a new function and select Author from scratch.
For Function name, enter BankingBotEnglish.
For Runtime, choose Python 3.8.
Choose Create function.
In the Code source section, open lambda_function.py and delete the existing code.
Download the function code and open it in a text editor.
Copy the code and enter it into the empty function code field.
Choose deploy.
On the Amazon Lex console, select the bot BankingBot.
Choose Deployment and then Aliases, then choose the alias TestBotAlias.
On the Aliases page, choose Languages and choose English (GB).
For Source, select the bot BankingBotEnglish.
For Lambda version or alias, enter $LATEST.
On the DynamoDB console, choose Create table.
Provide the name as customerDatabase.
Provide the partition key as accountNumber.
Add an item with accountNumber: “1111222233334444” and mothersMaidenName “Loreck”.
Add item with accountNumber: “5555666677778888” and mothersMaidenName “Smythe”.
Make sure the Lambda function has permissions to read from the DynamoDB table customerDatabase.
On the Amazon Connect console, choose Contact flows.
In the Amazon Lex section, select your Amazon Lex bot and make it available for use in the Amazon Connect contact flow.
Download the contact flow to integrate with the Amazon Lex bot.
Choose the contact flow to load it into the application.
Make sure the right bot is configured in the “Get Customer Input” block.
Choose a queue in the “Set working queue” block.
Add a phone number to the contact flow.
Test the IVR flow by calling in to the phone number.

Test the solution

You can now call in to the Amazon Connect phone number and interact with the bot.

Conclusion

Runtime hints allow you to influence the transcription of words or phrases dynamically in the conversation. You can use business logic to identify the hints as the conversation evolves. Better recognition of the user input allows you to deliver an enhanced experience. You can configure runtime hints via the Lex V2 SDK. The capability is available in all AWS Regions where Amazon Lex operates in the English (Australia), English (UK), and English (US) locales.

To learn more, refer to runtime hints.

About the Authors

Kai Loreck is a professional services Amazon Connect consultant. He works on designing and implementing scalable customer experience solutions. In his spare time, he can be found playing sports, snowboarding, or hiking in the mountains.

Anubhav Mishra is a Product Manager with AWS. He spends his time understanding customers and designing product experiences to address their business challenges.

Sravan Bodapati is an Applied Science Manager at AWS Lex. He focuses on building cutting edge Artificial Intelligence and Machine Learning solutions for AWS customers in ASR and NLP space. In his spare time, he enjoys hiking, learning economics, watching TV shows and spending time with his family.

Read MoreAWS Machine Learning Blog

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments