• Home
  • blog
  • Provide mobile subscribers with a natural and efficient customer service experience with Amazon Lex

Provide mobile subscribers with a natural and efficient customer service experience with Amazon Lex

This post is a translation of ”Deliver natural and efficient customer service experiences to mobile subscribers with Amazon Lex”.

Mobile carrier providers handle a high volume of customer service calls every day. Rapidly evolving network technology and device innovation are changing customer expectations. Delighting your customers with fast interactions is critical to a successful customer experience strategy. Mobile subscribers contact customer support for several reasons, such as creating new SIM cards, changing plans, checking payment deadlines, canceling services, registering devices, unlocking SIMs, etc. To meet the needs of these subscribers, providers must extend customer service across multiple channels while increasing the efficiency and quality of communications through automation.

In this post, we review how to use pre-built solutions on Amazon Lex to automate customer interactions for SIM card issuance, bill payment, loss/theft reporting, and more . This allows you to provide a natural and efficient customer experience.

Solution Brief

Amazon Lex provides advanced deep learning capabilities for Automatic Speech Recognition (ASR) for converting speech to text and Natural Language Understanding (NLU) for recognizing intent in text provide. This allows you to build applications with highly engaging customer experiences and lifelike conversational interactions. Amazon Lex for telecom provides pre-built solutions to help you deliver a natural conversational experience while optimizing your service delivery model and making new communication and media technologies available to your customers. The pre-built bot consists of intents, sample utterances, slot types for mobile service use cases, and integrates with Amazon Connect contact flows.

Let's take a look at an example conversation about requesting a new SIM card, highlighting the various components in the pre-built solution.

In this conversation, the customer wants to request a new SIM card. The agent takes the passcode for verification and then starts reissuing the SIM card.

The pre-built solution includes a bot for authentication and a mobile service that can be deployed on Amazon Lex to automate conversations. MobileServicesBot includes common mobile service activities such as issuing new SIM cards, changing plans, getting bills, canceling services, registering new services, activating devices, changing numbers, etc. contains intents. Specifically, it includes the following intents:

The bot definition also includes a full conversation, along with prompts to manage the conversation. Each bot is also integrated with an AWS Lambda function containing code that simulates business logic. Integration with Amazon Kendra enables you to answer natural language questions during a conversation.

Solution Architecture

Let's see the overall architecture of the solution (see the following figure).

This post contains a template that creates an AWS CloudFormation stack with AWS resources and the required AWS Identity and Access Management (IAM) roles. With these resources, you can use pre-built solutions for mobile services in your Amazon Connect channel.

Mobile enrollment using Amazon Lex

Prerequisites

The following prerequisites are required before deploying the solution.

  • Optional Amazon Connect instance (if deploying to Amazon Connect)
  • Deploy the pre-built solution

    Use the following steps to deploy the solution.

    1. Click Launch Stack to launch the AWS CloudFormation stack creation in the selected region. In Stack Name, enter a name for your stack. This post uses the name mobile-services-solution as shown in the following screenshot.
    2. In the parameters section, enter the Amazon Lex bot, the name of your DynamoDB table, and the ARN of your Amazon Connect instance.
    3. Approve the creation of the IAM resource and click Create Stack. After a few minutes, the stack creation should complete. The core resource that is created looks like this:
    4. If you specified an ARN for Connect while creating the stack, go to the Amazon Connect dashboard and select Phone Numbers from the Routing menu in the navigation pane.
    5. Next, associate the phone number with the mobile service contact flow. Once your phone numbers are associated, you're ready to test your solution.

    Test your solution

    You can test your bot with sample data. When deployed to an Amazon Connect instance, you can interact with your bot by calling an Amazon Connect phone number. You can also test your solution directly in the Amazon Lex V2 console using voice or text. After trying out the pre-built conversation flow, you can customize your bot, add intents as needed, and integrate with other backend systems.

    Mobile Services: Key Features

    Let's take a look at some of the features provided by the prebuilt solution, such as backend system data validation and contact flow.

    Validate User Input

    The agent authenticates the customer by verifying the last four digits of their registered Social Security Number (SSN) or passcode. If this validation fails, the agent asks the customer to provide the information again. A prebuilt solution provides a Lambda function that performs validation using information stored in a backend system. Additionally, pre-built solutions provide logic to limit the number of authentication attempts. After the customer enters incorrect information three times, the bot ends the call.

    The following code shows how to use account information to validate user input.

    phone_number = dialog.get_slot('PhoneNumber', intent)zip_code = dialog.get_slot('Zipcode', intent)status, customer_id = mobile_system.get_customer_id(phone_number, zip_code)if status == 'INVALID': # unauthorized user … …else: # proceed with authentication fulfillment … …

    The following code shows how to limit the number of attempts using session attributes.

    number_of_attempts = number_of_attempts + 1dialog.set_session_attribute(intent_request, 'number_of_attempts', str(number_of_attempts))if status == 'INVALID':# unauthorized userif number_of_attempts >= 3:message = "For your security, we are unable to complete your request, \until you are able to provide required information. 'PlainText', 'content': message}])if number_of_attempts == 1:prompt = "I didn't find a match. Please say or enter your phone number. \ If you need time to get that information, say, wait a moment."elif number_of_attempts == 2:prompt = "I didn't find a match. Please try one last time. \Say or enter your phone number"return dialog.elicit_slot( 'PhoneNumber', active_contexts, session_attributes, init_state, [{'contentType': 'PlainText', 'content': prompt}])else:# proceed with authentication fulfillmentmessage = "Thanks for being our customer."intent_request = dialog.set_session_attribute(intent_request, 'authentication_status', 'AUTHENTICATED') dialog.set_session_attribute(intent_request, 'phone_number', phone_number) dialog.set_session_attribute(intent_request, 'customer_id', customer_id)session_attributes = dialog.get_session_attributes(intent_request)return dialog.close(active_contexts, session_attributes, intent, [{'contentType': ' SSML', 'content': message}])

    Integrate with a database

    Agents need to retrieve information periodically during a call. For example, a customer may want to know the amount due ("How much is my bill this month?") or due date ("When is my payment due this month?"). Pre-built solutions include placeholder Lambda functions with business logic code that you can integrate with your backend systems. Separating conversation management from business logic makes code easier to build and maintain.

    The following code shows how to integrate with a backend system to retrieve relevant information.

    payment_due = mobile_system.get_payment_due(customer_id)if not payment_due: response = responses.get('PaymentDueNotAvailable') return dialog.elicit_intent(active_contexts, session_attributes, intent,[{'contentType': 'PlainText', ' content': response}])response = responses.get( 'Response', payment_due_balance=payment_due['payment_due_balance'], payment_due_date=payment_due['payment_due_date'],last_payment_amount=payment_due['last_payment_amount'], last_payment_date=payment_due['last_payment_date '])return dialog.elicit_intent( active_contexts, session_attributes, intent, [{'contentType': 'PlainText', 'content': response}])

    The following code stub is a DynamoDB It shows how to access the sample data in .

    def get_payment_due(customer_id):customer = telecomdb.query(KeyConditionExpression=Key('customer_id').eq(customer_id),FilterExpression=Attr("record_type").eq('mobile'))if customer and len(customer) == 0: return Nonecustomer = customer.get('Items')[0]payment_due = {}payment_due['payment_due_balance'] \= customer['due_payment']['payment_due_balance']payment_due['payment_due_date '] = \= customer['due_payment']['payment_due_date']payment_due['last_payment_amount'] \= customer['last_payment']['last_payment_amount']payment_due['last_payment_date'] = \ customer['last_payment'][ 'last_payment_date']return payment_due

    Contact Center Flow

    You can deploy a pre-built solution as part of your Amazon Connect contact flow. When a customer calls your contact center, the contact flow that handles it is the contact flow assigned to the phone number that the customer called. The contact flow calls the Amazon Lex bot with a block that takes customer input. The following diagram shows the contact flow.

    Clean Up

    Remove any resources you created to avoid incurring charges in the future.

    1. Amazon Lex Bot
    2. Lambda Function
    3. DynamoDB Table
    4. Amazon Connect Contact Flow
    5. IAM Role
    6. li>

    Conclusion

    Amazon Lex for telecom provides pre-built solutions to help you deliver engaging and sophisticated conversational experiences. In this post, we reviewed solutions for mobile service customers to automate common tasks such as SIM card and device registration, plan changes, payments, and device activation. With AWS as your foundation, you can transform customer engagement while simplifying your operations as a secure infrastructure. The pre-built solution also provides a ready-to-deploy contact center configuration with Amazon Connect. You can easily extend the solution by adding conversation flows that fit your business needs. Please try the mobile service solution built with Amazon Lex!

    About the author

    Jaya Prakash Kommu is the Technology Lead for the Smartbots.ai team. She manages a team as an AI engineer building next-generation conversational AI interfaces. When he's not designing bots, he enjoys playing soccer.

    Sandeep Srinivasan is a product manager on the Amazon Lex team. As an avid observer of human behavior, he is passionate about the customer experience. He spends his waking hours at the intersection of people, technology and the future.

    Translation by Solution Architect Ming Yang. Here is the original.