• Home
  • blog
  • Use Amazon Lex to provide mobile subscribers with a natural and efficient customer service experience | Amazon Web Services Blog

Use Amazon Lex to provide mobile subscribers with a natural and efficient customer service experience | Amazon Web Services Blog

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

Mobile carrier providers handle large numbers of customer service calls daily. Rapidly evolving network technology and device innovations are changing customer expectations. Delighting your customers with quick interactions is critical to the success of your customer experience strategy. The mobile subscriber contacts customer support for several reasons, including creating a new SIM card, changing plans, checking payment deadlines, canceling services, registering devices, unlocking SIMs, and more. To meet the needs of these subscribers, providers need to expand customer service across multiple channels while improving the efficiency and quality of communications through automation.

In this post, we'll see how you can use a solution built with Amazon Lex to automate customer interactions for SIM card issuance, payments, stolen or lost reports, and more. This allows us to provide a natural and efficient customer experience.

Solution overview

Amazon Lex provides advanced deep learning capabilities for automatic speech recognition (ASR) for converting speech to text and natural language understanding (NLU) for recognizing the intent of text. This allows you to build applications with a very compelling customer experience and realistic conversational interactions. Amazon Lex for telecom optimizes service delivery models and provides pre-built solutions to deliver a natural conversational experience while making new communication and media technologies available to customers. The pre-built bot consists of intents, sample utterances, and slot types for mobile service use cases and is integrated with the Amazon Connect contact flow.

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

In this conversation, the customer wants to request a new SIM card. The agent gets 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 you can deploy to Amazon Lex to automate conversations. MobileServicesBot includes invoices for common mobile service activities such as issuing a new SIM card, changing plans, getting invoices, canceling services, registering new services, activating devices, changing numbers, etc. increase. Specifically, it includes the following intents:

The bot definition includes a complete conversation as well as a prompt to manage the conversation. Each bot is also integrated with an AWS Lambda function that contains code that simulates business logic. Integration with Amazon Kendra allows you to answer natural language questions during a conversation.

Solution architecture

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

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

Prerequisites

The following prerequisites are required before deploying the solution:

  • Optionally, an Amazon Connect instance (when deploying to Amazon Connect)
  • Deploy a pre-built solution

    Follow these steps to deploy the solution.

    1. Click Launch Stack to launch AWS CloudFormation Stack Creation in the selected region. For Stack Name, type the name of the stack. This post uses the name mobile-services-solution, as shown in the screenshot below.
    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 be complete. The core resources created are as follows.
    4. If you specified a Connect ARN while creating the stack, go to the Amazon Connect dashboard and choose a phone number from the Routing menu in the navigation pane.
    5. Then associate the phone number with the mobile service contact flow. Once the phone number is associated, you're ready to test your solution.

    Test the solution

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

    Mobile services: main features

    Let's take a look at some of the features provided by pre-built solutions, such as data validation of back-end systems and contact flows.

    The agent authenticates the customer by verifying the last four digits of the registered Social Security Number (SSN) or passcode. If this validation fails, the agent requests the customer to provide the information again. The pre-built solution provides a Lambda function that performs validation using the information stored on the back-end system. In addition, the pre-built solution provides logic to limit the number of authentication attempts. If the customer enters the wrong information three times, the bot will end the call.

    The following code shows how to use your 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 use session attributes to limit the number of attempts.

     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. Goodbye"dialog.set_session_attribute(intent_request, 'authentication_status', 'UNAUTHENTICATED')return dialog.close(active_contexts, session_attributes, intent, [{'contentType': '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}])

    Agents need to get information on a regular basis during a call. For example, a customer may want to know the payment amount ("How much is this month's bill?") ​​Or the due date ("When is this month's payment date?"). The pre-built solution includes his Lambda function in a placeholder with business logic code that can be integrated with the backend system. Separating conversation management and business logic makes it easier to build and maintain code.

    The following code shows how to integrate with the backend system to get 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 shows how to access the DynamoDB sample data.

     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

    You can deploy a pre-built solution as part of your Amazon Connect contact flow. When a customer calls the contact center, the contact flow to process is the contact flow assigned to the phone number the customer called. The contact flow calls her Amazon Lex bot with a block that gets the customer's input. The following figure shows the query flow.

    Cleanup

    Delete all the resources you have created so that you will not be charged in the future.

    1. Amazon Lex bot
    2. Lambda function
    3. DynamoDB table
    4. Amazon Connect Inquiry Flow
    5. IAM roll

    Conclusion

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


    Jaya Prakash Kommu is the technology leader for her Smartbots.ai team. She builds the next generation of conversational AI interfaces She manages the team as an AI engineer. She enjoys playing soccer when she isn't designing bots.

    Sandeep Srinivasan is the product manager for the Amazon Lex team. As an observer enthusiastic about human behavior, he is passionate about the customer experience. He spends his time awake at the crossroads of people, technology, and the future.

    The translation was done by Ming Yang of Solution Architect. The original text is here.