Expedite IVR development with industry grammars on Amazon Lex

Amazon Lex is a service for building conversational interfaces into any application using voice and text. With Amazon Lex, you can easily build sophisticated, natural language, conversational bots (chatbots), virtual agents, and interactive voice response (IVR) systems. You can now use industry grammars to accelerate IVR development on Amazon Lex as part of your IVR migration effort. Industry grammars are a set of XML files made available as a grammar slot type. You can select from a range of pre-built industry grammars across domains, such as financial services, insurance, and telecom. In this post, we review the industry grammars for these industries and use them to create IVR experiences.

Financial services

You can use Amazon Lex in the financial services domain to automate customer service interactions such as credit card payments, mortgage loan applications, portfolio status, and account updates. During these interactions, the IVR flow needs to collect several details, including credit card number, mortgage loan ID, and portfolio details, to fulfill the user’s request. We use the financial services industry grammars in the following sample conversation:

Agent: Welcome to ACME bank. To get started, can I get your account ID?

User: Yes, it’s AB12345.

IVR: Got it. How can I help you?

User: I’d like to transfer funds to my savings account.

IVR: Sure. How much would you like to transfer?

User: $100

IVR: Great, thank you.

The following grammars are supported for financial services: account ID, credit card number, transfer amount, and different date formats such as expiration date (mm/yy) and payment date (mm/dd).

Let’s review the sample account ID grammar. You can refer to the other grammars in the documentation.





        

        
            out=""
            out += rules.alphanumeric.alphanum;
            out += rules.alphabets.letters;
            out += rules.digits.numbers
        

        
            
            
                account number is
                Account Number
                Here is my Account Number 
                Yes, It is
                Yes It is
                Yes It's
                My account Id is
                This is the account Id
                account Id
            
        

        
          
             Hmm
             Mmm
             My
          
        

        
            out.alphanum=""
            out.alphanum += rules.alphabets.letters;
            out.alphanum += rules.digits.numbers
        

        
            
            out.letters=""
            out.firstOccurence=""
            out.firstOccurence += rules.digits.numbers; out.letters += out.firstOccurence;
            
                
                    Aout.letters+='A';
                    Bout.letters+='B';
                    Cout.letters+='C';
                    Dout.letters+='D';
                    Eout.letters+='E';
                    Fout.letters+='F';
                    Gout.letters+='G';
                    Hout.letters+='H';
                    Iout.letters+='I';
                    Jout.letters+='J';
                    Kout.letters+='K';
                    Lout.letters+='L';
                    Mout.letters+='M';
                    Nout.letters+='N';
                    Oout.letters+='O';
                    Pout.letters+='P';
                    Qout.letters+='Q';
                    Rout.letters+='R';
                    Sout.letters+='S';
                    Tout.letters+='T';
                    Uout.letters+='U';
                    Vout.letters+='V';
                    Wout.letters+='W';
                    Xout.letters+='X';
                    Yout.letters+='Y';
                    Zout.letters+='Z';
                
            
        

        
            
            out.numbers=""
            
                
                    0out.numbers+=0;
                    1out.numbers+=1;
                    2out.numbers+=2;
                    3out.numbers+=3;
                    4out.numbers+=4;
                    5out.numbers+=5;
                    6out.numbers+=6;
                    7out.numbers+=7;
                    8out.numbers+=8;
                    9out.numbers+=9;
                
            
        

Using the industry grammar for financial services

To create the sample bot and add the grammars, perform the following steps. This creates an Amazon Lex bot called Financialbot and adds the grammars for financial services, which we store in Amazon Simple Storage Service (Amazon S3):

  1. Download the Amazon Lex bot definition.
  2. On the Amazon Lex console, choose Actions and then choose Import.
  3. Choose the Financialbot.zip file that you downloaded, and choose Import.
  4. Copy the grammar XML files for financial services, listed in the preceding section.
  5. On the Amazon S3 console, upload the XML files.
  6. Navigate to the slot types on the Amazon Lex console and choose the accountID slot type so you can associate the fin_accountNumber.grxml file.
  7. In the slot type, enter the Amazon S3 link for the XML file and the object key.
  8. Choose Save slot type.

The AWS Identity and Access Management (IAM) role used to create the bot must have permission to read files from the S3 bucket.

  1. Repeat steps 6–8 for the transferFunds slot type with fin_transferAmount.grxml.
  2. After you save the grammars, choose Build.
  3. Download the financial services contact flow to integrate it with the Amazon Lex bot via Amazon Connect.
  4. On the Amazon Connect console, choose Contact flows.
  5. In the Amazon Lex section, select your Amazon Lex bot and make it available for use in the Amazon Connect contact flows.
  6. Select the contact flow to load it into the application.
  7. Test the IVR flow by calling in to the phone number.

Insurance

You can use Amazon Lex in the insurance domain to automate customer service interactions such as claims processing, policy management, and premium payments. During these interactions, the IVR flow needs to collect several details, including policy ID, license plate, and premium amount, to fulfill the policy holder’s request. We use the insurance industry grammars in the following sample conversation:

Agent: Welcome to ACME insurance company. To get started, can I get your policy ID?

Caller: Yes, it’s AB1234567.

IVR: Got it. How can I help you?

Caller: I’d like to file a claim.

IVR: Sure. Is this claim regarding your auto policy or home owners’ policy?

Caller: Auto

IVR: What’s the license plate on the vehicle?

Caller: ABCD1234

IVR: Thank you. And how much is the claim for?

Caller: $900

IVR: What was the date and time of the accident?

Caller: March 1st 2:30pm.

IVR: Thank you. I’ve got that started for you. Someone from our office should be in touch with you shortly. Your claim ID is 12345.

The following grammars are supported for the insurance domain: policy ID, driver’s license, social security number, license plate, claim number, and renewal date.

Let’s review the sample claimDateTime grammar. You can refer to the other grammars in the documentation.




         

        
            out=""
            
                out = out + rules.months + " ";
                
                    out += rules.digits + " ";
                    out += rules.teens+ " ";
                    out += rules.above_twenty+ " ";
                
                out += rules.at.new;
                out +=":" + rules.mins.min;
                out += rules.ampm;
            
            
        

        
           
             The accident occured at
             Time of accident is
             Damage was reported at
             Schedule virtual inspection for
           
        

        
            
               Thanks
               I think
            
          

        
           
           
             januaryout="january";
             februaryout="february";
             marchout="march";
             aprilout="april";
             mayout="may";
             juneout="june";
             julyout="july";
             augustout="august";
             septemberout="september";
             octoberout="october";
             novemberout="november";
             decemberout="december";
             janout="january";
             febout="february";
             augout="august";
             septout="september";
             octout="october";
             novout="november";
             decout="december";
           
       

        
            
                0out=0;
                1out=1;
                2out=2;
                3out=3;
                4out=4;
                5out=5;
                6out=6;
                7out=7;
                8out=8;
                9out=9;
                firstout=1;
                secondout=2;
                thirdout=3;
                fourthout=4;
                fifthout=5;
                sixthout=6;
                seventhout=7;
                eighthout=8;
                ninthout=9;
                oneout=1;
                twoout=2;
                threeout=3;
                fourout=4;
                fiveout=5;
                sixout=6;
                sevenout=7;
                eightout=8;
                nineout=9;
            
        


      
        out.new=""
        at
        
          out.new+= rules.digits
          out.new+= rules.teens
        
      

      
        out.min=""
        :
        and
        
          out.min+= rules.digits
          out.min+= rules.teens
          out.min+= rules.above_twenty
        
      

      
            out=""
            
                AMout="am";
                PMout="pm";
                amout="am";
                pmout="pm";
            
        


        
            
                tenout=10;
                tenthout=10;
                elevenout=11;
                twelveout=12;
                thirteenout=13;
                fourteenout=14;
                fifteenout=15;
                sixteenout=16;
                seventeenout=17;
                eighteenout=18;
                nineteenout=19;
                tenthout=10;
                eleventhout=11;
                twelvethout=12;
                thirteenthout=13;
                fourteenthout=14;
                fifteenthout=15;
                sixteenthout=16;
                seventeenthout=17;
                eighteenthout=18;
                nineteenthout=19;
            
        

        
            
                twentyout=20;
                thirtyout=30;
            
            out += rules.digits;
        

Using the industry grammar for insurance

To create the sample bot and add the grammars, perform the following steps. This creates an Amazon Lex bot called InsuranceBot and adds the grammars for the insurance domain:

  1. Download the Amazon Lex bot definition.
  2. On the Amazon Lex console, choose Actions, then choose Import.
  3. Choose the InsuranceBot.zip file that you downloaded, and choose Import.
  4. Copy the grammar XML files for insurance, listed in the preceding section.
  5. On the Amazon S3 console, upload the XML files.
  6. Navigate to the slot types on the Amazon Lex console and select the policyID slot type so you can associate the ins_policyNumber.grxml grammar file.
  7. In the slot type, enter the Amazon S3 link for the XML file and the object key.
  8. Choose Save slot type.

The IAM role used to create the bot must have permission to read files from the S3 bucket.

  1. Repeat steps 6–8 for the licensePlate slot type (ins_NJ_licensePlateNumber.grxml) and dateTime slot type (ins_claimDateTime.grxml).
  2. After you save the grammars, choose Build.
  3. Download the insurance contact flow to integrate with the Amazon Lex bot.
  4. On the Amazon Connect console, choose Contact flows.
  5. In the Amazon Lex section, and select your Lex bot and make it available for use in the Amazon Connect contact flows.
  6. Select the contact flow to load it into the application.
  7. Test the IVR flow by calling in to the phone number.

Telecom

You can use Amazon Lex in the telecom domain to automate customer service interactions such as activating service, paying bills, and managing device installations. During these interactions, the IVR flow needs to collect several details, including SIM number, zip code, and the service start date, to fulfill the user’s request. We use the financial services industry grammars in the following sample conversation:

Agent: Welcome to ACME cellular. To get started, can I have the telephone number associated with your account?

User: Yes, it’s 123 456 7890.

IVR: Thanks. How can I help you?

User: I am calling to activate my service.

IVR: Sure. What’s the SIM number on the device?

IVR: 12345ABC

IVR: Ok. And can I have the zip code?

User: 12345

IVR: Great, thank you. The device has been activated.

The following grammars are supported for telecom: SIM number, device serial number, zip code, phone number, service start date, and ordinals.

Let’s review the sample SIM number grammar. You can refer to the other grammars in the documentation.





        

        
            out=""
            out += rules.alphanumeric.alphanum;
            out += rules.alphabets.letters;
            out += rules.digits.numbers
        

        
            
            
                My SIM number is
                SIM number is
            
        

        
          
             Hmm
             Mmm
             My
          
        

        
            out.alphanum=""
            out.alphanum += rules.alphabets.letters;
            out.alphanum += rules.digits.numbers
        

        
            
            out.letters=""
            out.firstOccurence=""
            out.firstOccurence += rules.digits.numbers; out.letters += out.firstOccurence;
            
                
                    Aout.letters+='A';
                    Bout.letters+='B';
                    Cout.letters+='C';
                    Dout.letters+='D';
                    Eout.letters+='E';
                    Fout.letters+='F';
                    Gout.letters+='G';
                    Hout.letters+='H';
                    Iout.letters+='I';
                    Jout.letters+='J';
                    Kout.letters+='K';
                    Lout.letters+='L';
                    Mout.letters+='M';
                    Nout.letters+='N';
                    Oout.letters+='O';
                    Pout.letters+='P';
                    Qout.letters+='Q';
                    Rout.letters+='R';
                    Sout.letters+='S';
                    Tout.letters+='T';
                    Uout.letters+='U';
                    Vout.letters+='V';
                    Wout.letters+='W';
                    Xout.letters+='X';
                    Yout.letters+='Y';
                    Zout.letters+='Z';
                
            
        

        
            
            out.numbers=""
            
                
                    0out.numbers+=0;
                    1out.numbers+=1;
                    2out.numbers+=2;
                    3out.numbers+=3;
                    4out.numbers+=4;
                    5out.numbers+=5;
                    6out.numbers+=6;
                    7out.numbers+=7;
                    8out.numbers+=8;
                    9out.numbers+=9;
                
            
        

Using the industry grammar for telecom

To create the sample bot and add the grammars, perform the following steps. This creates an Amazon Lex bot called TelecomBot and adds the grammars for telecom:

  1. Download the Amazon Lex bot definition.
  2. On the Amazon Lex console, choose Actions, then choose Import.
  3. Choose the TelecomBot.zip file that you downloaded, and choose Import.
  4. Copy the grammar XML files for the telecom domain, listed in the preceding section.
  5. On the Amazon S3 console, upload the XML files.
  6. Navigate to the slot types on the Amazon Lex console and select phoneNumber so you can associate the tel_phoneNumber.grxml grammar.
  7. In the slot type, enter the Amazon S3 link for the XML file and the object key.
  8. Choose Save slot type.

The IAM role used to create the bot must have permission to read files from the S3 bucket.

  1. Repeat steps 6–8 for the slot types SIM number (tel_simNumber.grxml) and zipcode (tel_usZipcode.grxml).
  2. After you save the grammars, choose Build.
  3. Download the insurance contact flow to integrate with the Amazon Lex bot.
  4. On the Amazon Connect console, choose Contact flows.
  5. In the Amazon Lex section, and select your Amazon Lex bot and make it available for use in the Amazon Connect contact flows.
  6. Select the contact flow to load it into the application.
  7. Test the IVR flow by calling in to the phone number.

Test the solution

You can call in to the Amazon Connect phone number and interact with the bot. You can also test the solution directly on the Amazon Lex V2 console using voice or text.

Conclusion

Industry grammars provide a set of pre-built XML files that you can use to quickly create IVR flows. You can select grammars to enable customer service conversations for use cases across financial services, insurance, and telecom. The grammars are available as a grammar slot type and can be used in an Amazon Lex bot configuration. You can download the grammars and enable these via the Amazon Lex V2 console or 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 Using a custom grammar slot type.


About the Authors

John Heater has over 15 years of experience in AI and automation. As the SVP of the Contact Center Practice at NeuraFlash, he leads the implementation of the latest AI and automation techniques for a portfolio of products and customer solutions.

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

View Original Source (aws.amazon.com) Here.

Leave a Reply

Your email address will not be published. Required fields are marked *

Shared by: AWS Machine Learning

Tags: