{"id":2004,"date":"2022-03-23T01:44:57","date_gmt":"2022-03-23T01:44:57","guid":{"rendered":"https:\/\/salarydistribution.com\/machine-learning\/2022\/03\/23\/expedite-ivr-development-with-industry-grammars-on-amazon-lex\/"},"modified":"2022-03-23T01:44:57","modified_gmt":"2022-03-23T01:44:57","slug":"expedite-ivr-development-with-industry-grammars-on-amazon-lex","status":"publish","type":"post","link":"https:\/\/salarydistribution.com\/machine-learning\/2022\/03\/23\/expedite-ivr-development-with-industry-grammars-on-amazon-lex\/","title":{"rendered":"Expedite IVR development with industry grammars on Amazon Lex"},"content":{"rendered":"<div id=\"\">\n<p><a href=\"https:\/\/aws.amazon.com\/lex\/\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Lex<\/a> 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 <a href=\"https:\/\/docs.aws.amazon.com\/lexv2\/latest\/dg\/building-srgs.html\" target=\"_blank\" rel=\"noopener noreferrer\">grammar slot type<\/a>. 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.<\/p>\n<h2>Financial services<\/h2>\n<p>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\u2019s request. We use the financial services industry grammars in the following sample conversation:<\/p>\n<p><em>Agent: Welcome to ACME bank. To get started, can I get your account ID?<\/em><\/p>\n<p><em>User: Yes, it\u2019s AB12345.<\/em><\/p>\n<p><em>IVR: Got it. How can I help you?<\/em><\/p>\n<p><em>User: I\u2019d like to transfer funds to my savings account.<\/em><\/p>\n<p><em>IVR: Sure. How much would you like to transfer?<\/em><\/p>\n<p><em>User: $100<\/em><\/p>\n<p><em>IVR: Great, thank you.<\/em><\/p>\n<p>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).<\/p>\n<p>Let\u2019s review the sample\u00a0<a class=\"c-link\" href=\"https:\/\/aws-blogs-artifacts-public.s3.amazonaws.com\/artifacts\/ML-8745\/fin_accountNumber.grxml\" target=\"_blank\" rel=\"noopener noreferrer\" data-stringify-link=\"https:\/\/aws-blogs-artifacts-public.s3.amazonaws.com\/artifacts\/ML-8745\/fin_accountNumber.grxml\" data-sk=\"tooltip_parent\" data-remove-tab-index=\"true\">account ID<\/a> grammar. You can refer to the other grammars in the <a href=\"https:\/\/docs.aws.amazon.com\/lexv2\/latest\/dg\/grammar-industry.html\">documentation<\/a>.<\/p>\n<div class=\"hide-language\">\n<pre><code class=\"lang-xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;\n&lt;grammar xmlns=\"http:\/\/www.w3.org\/2001\/06\/grammar\"\n         xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n         xsi:schemaLocation=\"http:\/\/www.w3.org\/2001\/06\/grammar\n                             http:\/\/www.w3.org\/TR\/speech-grammar\/grammar.xsd\"\n         xml:lang=\"en-US\" version=\"1.0\"\n         root=\"main\"\n         mode=\"voice\"\n         tag-format=\"semantics\/1.0\"&gt;\n\n\n        &lt;!-- Test Cases\n\n        Grammar will support the following inputs:\n\n            Scenario 1:\n                Input: My account number is A B C 1 2 3 4\n                Output: ABC1234\n\n            Scenario 2:\n                Input: My account number is 1 2 3 4 A B C\n                Output: 1234ABC\n\n            Scenario 3:\n                Input: Hmm My account number is 1 2 3 4 A B C 1\n                Output: 123ABC1\n        --&gt;\n\n        &lt;rule id=\"main\" scope=\"public\"&gt;\n            &lt;tag&gt;out=\"\"&lt;\/tag&gt;\n            &lt;item&gt;&lt;ruleref uri=\"#alphanumeric\"\/&gt;&lt;tag&gt;out += rules.alphanumeric.alphanum;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#alphabets\"\/&gt;&lt;tag&gt;out += rules.alphabets.letters;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#digits\"\/&gt;&lt;tag&gt;out += rules.digits.numbers&lt;\/tag&gt;&lt;\/item&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"text\"&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#hesitation\"\/&gt;&lt;\/item&gt;\n            &lt;one-of&gt;\n                &lt;item repeat=\"0-1\"&gt;account number is&lt;\/item&gt;\n                &lt;item repeat=\"0-1\"&gt;Account Number&lt;\/item&gt;\n                &lt;item repeat=\"0-1\"&gt;Here is my Account Number &lt;\/item&gt;\n                &lt;item repeat=\"0-1\"&gt;Yes, It is&lt;\/item&gt;\n                &lt;item repeat=\"0-1\"&gt;Yes It is&lt;\/item&gt;\n                &lt;item repeat=\"0-1\"&gt;Yes It's&lt;\/item&gt;\n                &lt;item repeat=\"0-1\"&gt;My account Id is&lt;\/item&gt;\n                &lt;item repeat=\"0-1\"&gt;This is the account Id&lt;\/item&gt;\n                &lt;item repeat=\"0-1\"&gt;account Id&lt;\/item&gt;\n            &lt;\/one-of&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"hesitation\"&gt;\n          &lt;one-of&gt;\n             &lt;item&gt;Hmm&lt;\/item&gt;\n             &lt;item&gt;Mmm&lt;\/item&gt;\n             &lt;item&gt;My&lt;\/item&gt;\n          &lt;\/one-of&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"alphanumeric\" scope=\"public\"&gt;\n            &lt;tag&gt;out.alphanum=\"\"&lt;\/tag&gt;\n            &lt;item&gt;&lt;ruleref uri=\"#alphabets\"\/&gt;&lt;tag&gt;out.alphanum += rules.alphabets.letters;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#digits\"\/&gt;&lt;tag&gt;out.alphanum += rules.digits.numbers&lt;\/tag&gt;&lt;\/item&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"alphabets\"&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#text\"\/&gt;&lt;\/item&gt;\n            &lt;tag&gt;out.letters=\"\"&lt;\/tag&gt;\n            &lt;tag&gt;out.firstOccurence=\"\"&lt;\/tag&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#digits\"\/&gt;&lt;tag&gt;out.firstOccurence += rules.digits.numbers; out.letters += out.firstOccurence;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;item repeat=\"1-\"&gt;\n                &lt;one-of&gt;\n                    &lt;item&gt;A&lt;tag&gt;out.letters+='A';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;B&lt;tag&gt;out.letters+='B';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;C&lt;tag&gt;out.letters+='C';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;D&lt;tag&gt;out.letters+='D';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;E&lt;tag&gt;out.letters+='E';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;F&lt;tag&gt;out.letters+='F';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;G&lt;tag&gt;out.letters+='G';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;H&lt;tag&gt;out.letters+='H';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;I&lt;tag&gt;out.letters+='I';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;J&lt;tag&gt;out.letters+='J';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;K&lt;tag&gt;out.letters+='K';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;L&lt;tag&gt;out.letters+='L';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;M&lt;tag&gt;out.letters+='M';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;N&lt;tag&gt;out.letters+='N';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;O&lt;tag&gt;out.letters+='O';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;P&lt;tag&gt;out.letters+='P';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;Q&lt;tag&gt;out.letters+='Q';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;R&lt;tag&gt;out.letters+='R';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;S&lt;tag&gt;out.letters+='S';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;T&lt;tag&gt;out.letters+='T';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;U&lt;tag&gt;out.letters+='U';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;V&lt;tag&gt;out.letters+='V';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;W&lt;tag&gt;out.letters+='W';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;X&lt;tag&gt;out.letters+='X';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;Y&lt;tag&gt;out.letters+='Y';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;Z&lt;tag&gt;out.letters+='Z';&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;\/one-of&gt;\n            &lt;\/item&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"digits\"&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#text\"\/&gt;&lt;\/item&gt;\n            &lt;tag&gt;out.numbers=\"\"&lt;\/tag&gt;\n            &lt;item repeat=\"1-10\"&gt;\n                &lt;one-of&gt;\n                    &lt;item&gt;0&lt;tag&gt;out.numbers+=0;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;1&lt;tag&gt;out.numbers+=1;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;2&lt;tag&gt;out.numbers+=2;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;3&lt;tag&gt;out.numbers+=3;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;4&lt;tag&gt;out.numbers+=4;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;5&lt;tag&gt;out.numbers+=5;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;6&lt;tag&gt;out.numbers+=6;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;7&lt;tag&gt;out.numbers+=7;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;8&lt;tag&gt;out.numbers+=8;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;9&lt;tag&gt;out.numbers+=9;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;\/one-of&gt;\n            &lt;\/item&gt;\n        &lt;\/rule&gt;\n&lt;\/grammar&gt;<\/code><\/pre>\n<\/p><\/div>\n<h3>Using the industry grammar for financial services<\/h3>\n<p>To create the sample bot and add the grammars, perform the following steps. This creates an Amazon Lex bot called <code>Financialbot<\/code> and adds the grammars for financial services, which we store in <a href=\"http:\/\/aws.amazon.com\/s3\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Simple Storage Service<\/a> (Amazon S3):<\/p>\n<ol>\n<li>Download the Amazon Lex bot <a href=\"https:\/\/aws-blogs-artifacts-public.s3.amazonaws.com\/artifacts\/ML-8745\/FinancialLexBot-DRAFT-4BNAR7MA9T-LexJson.zip\" target=\"_blank\" rel=\"noopener noreferrer\">definition<\/a>.<\/li>\n<li>On the Amazon Lex console, choose <strong>Actions <\/strong>and then choose<strong> Import<\/strong>.<\/li>\n<li>Choose the <code>Financialbot.zip<\/code> file that you downloaded, and choose <strong>Import<\/strong>.<\/li>\n<li>Copy the <a href=\"https:\/\/docs.aws.amazon.com\/lexv2\/latest\/dg\/samples\/financial-grammars.zip\" target=\"_blank\" rel=\"noopener noreferrer\">grammar XML files<\/a> for financial services, listed in the preceding section.<\/li>\n<li>On the Amazon S3 console, upload the XML files.<\/li>\n<li>Navigate to the slot types on the Amazon Lex console and choose the <code>accountID<\/code> slot type so you can associate the <code>fin_accountNumber.grxml<\/code> file.<\/li>\n<li>In the slot type, enter the Amazon S3 link for the XML file and the object key.<\/li>\n<li>Choose <strong>Save slot type<\/strong>.<\/li>\n<\/ol>\n<p>The <a href=\"http:\/\/aws.amazon.com\/iam\" target=\"_blank\" rel=\"noopener noreferrer\">AWS Identity and Access Management<\/a> (IAM) role used to create the bot must have permission to read files from the S3 bucket.<\/p>\n<ol start=\"9\">\n<li>Repeat steps 6\u20138 for the <code>transferFunds<\/code> slot type with <code>fin_transferAmount.grxml<\/code>.<\/li>\n<li>After you save the grammars, choose <strong>Build<\/strong>.<\/li>\n<li>Download the financial services <a href=\"https:\/\/aws-blogs-artifacts-public.s3.amazonaws.com\/artifacts\/ML-8745\/FinancialFlow\" target=\"_blank\" rel=\"noopener noreferrer\">contact flow<\/a> to integrate it with the Amazon Lex bot via <a href=\"https:\/\/aws.amazon.com\/connect\/\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Connect<\/a>.<\/li>\n<li>On the Amazon Connect console, choose <strong>Contact flows<\/strong>.<\/li>\n<li>In the <strong>Amazon Lex<\/strong> section, select your Amazon Lex bot and make it available for use in the Amazon Connect contact flows.<\/li>\n<li>Select the contact flow to load it into the application.<\/li>\n<li>Test the IVR flow by calling in to the phone number.<\/li>\n<\/ol>\n<h2>Insurance<\/h2>\n<p>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\u2019s request. We use the insurance industry grammars in the following sample conversation:<\/p>\n<p><em>Agent: Welcome to ACME insurance company. To get started, can I get your policy ID?<\/em><\/p>\n<p><em>Caller: Yes, it\u2019s AB1234567.<\/em><\/p>\n<p><em>IVR: Got it. How can I help you?<\/em><\/p>\n<p><em>Caller: I\u2019d like to file a claim.<\/em><\/p>\n<p><em>IVR: Sure. Is this claim regarding your auto policy or home owners\u2019 policy?<\/em><\/p>\n<p><em>Caller: Auto<\/em><\/p>\n<p><em>IVR: What\u2019s the license plate on the vehicle?<\/em><\/p>\n<p><em>Caller: ABCD1234<\/em><\/p>\n<p><em>IVR: Thank you. And how much is the claim for?<\/em><\/p>\n<p><em>Caller: $900<\/em><\/p>\n<p><em>IVR: What was the date and time of the accident?<\/em><\/p>\n<p><em>Caller: March 1st 2:30pm.<\/em><\/p>\n<p><em>IVR: Thank you. I\u2019ve got that started for you. Someone from our office should be in touch with you shortly. Your claim ID is 12345.<\/em><\/p>\n<p>The following grammars are supported for the insurance domain: policy ID, driver\u2019s license, social security number, license plate, claim number, and renewal date.<\/p>\n<p>Let\u2019s review the sample <a href=\"https:\/\/aws-blogs-artifacts-public.s3.amazonaws.com\/artifacts\/ML-8745\/ins_claimDateTime.grxml\" target=\"_blank\" rel=\"noopener noreferrer\">claimDateTime<\/a> grammar. You can refer to the other grammars in the <a href=\"https:\/\/docs.aws.amazon.com\/lexv2\/latest\/dg\/grammar-industry.html\">documentation<\/a>.<\/p>\n<div class=\"hide-language\">\n<pre><code class=\"lang-xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;\n&lt;grammar xmlns=\"http:\/\/www.w3.org\/2001\/06\/grammar\"\n         xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n         xsi:schemaLocation=\"http:\/\/www.w3.org\/2001\/06\/grammar\n                             http:\/\/www.w3.org\/TR\/speech-grammar\/grammar.xsd\"\n         xml:lang=\"en-US\" version=\"1.0\"\n         root=\"main\"\n         mode=\"voice\"\n         tag-format=\"semantics\/1.0\"&gt;\n\n         &lt;!-- Test Cases\n\n         Grammar will support the following inputs:\n\n             Scenario 1:\n                 Input: The accident occured at july three at five am\n                 Output:  july 3 5am\n\n             Scenario 2:\n                 Input: Damage was reported at july three at five am\n                 Output:  july 3 5am\n\n             Scenario 3:\n                 Input: Schedule virtual inspection for july three at five am\n                 Output:  july 3 5am\n         --&gt;\n\n        &lt;rule id=\"main\" scope=\"public\"&gt;\n            &lt;tag&gt;out=\"\"&lt;\/tag&gt;\n            &lt;item repeat=\"1-10\"&gt;\n                &lt;item&gt;&lt;ruleref uri=\"#months\"\/&gt;&lt;tag&gt;out = out + rules.months + \" \";&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;one-of&gt;\n                    &lt;item&gt;&lt;ruleref uri=\"#digits\"\/&gt;&lt;tag&gt;out += rules.digits + \" \";&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;&lt;ruleref uri=\"#teens\"\/&gt;&lt;tag&gt;out += rules.teens+ \" \";&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;&lt;ruleref uri=\"#above_twenty\"\/&gt;&lt;tag&gt;out += rules.above_twenty+ \" \";&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;\/one-of&gt;\n                &lt;item&gt;&lt;ruleref uri=\"#at\"\/&gt;&lt;tag&gt;out += rules.at.new;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#mins\"\/&gt;&lt;tag&gt;out +=\":\" + rules.mins.min;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;&lt;ruleref uri=\"#ampm\"\/&gt;&lt;tag&gt;out += rules.ampm;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;\/item&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#thanks\"\/&gt;&lt;\/item&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"text\"&gt;\n           &lt;one-of&gt;\n             &lt;item repeat=\"0-1\"&gt;The accident occured at&lt;\/item&gt;\n             &lt;item repeat=\"0-1\"&gt;Time of accident is&lt;\/item&gt;\n             &lt;item repeat=\"0-1\"&gt;Damage was reported at&lt;\/item&gt;\n             &lt;item repeat=\"0-1\"&gt;Schedule virtual inspection for&lt;\/item&gt;\n           &lt;\/one-of&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"thanks\"&gt;\n            &lt;one-of&gt;\n               &lt;item&gt;Thanks&lt;\/item&gt;\n               &lt;item&gt;I think&lt;\/item&gt;\n            &lt;\/one-of&gt;\n          &lt;\/rule&gt;\n\n        &lt;rule id=\"months\"&gt;\n           &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#text\"\/&gt;&lt;\/item&gt;\n           &lt;one-of&gt;\n             &lt;item&gt;january&lt;tag&gt;out=\"january\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;february&lt;tag&gt;out=\"february\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;march&lt;tag&gt;out=\"march\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;april&lt;tag&gt;out=\"april\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;may&lt;tag&gt;out=\"may\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;june&lt;tag&gt;out=\"june\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;july&lt;tag&gt;out=\"july\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;august&lt;tag&gt;out=\"august\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;september&lt;tag&gt;out=\"september\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;october&lt;tag&gt;out=\"october\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;november&lt;tag&gt;out=\"november\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;december&lt;tag&gt;out=\"december\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;jan&lt;tag&gt;out=\"january\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;feb&lt;tag&gt;out=\"february\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;aug&lt;tag&gt;out=\"august\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;sept&lt;tag&gt;out=\"september\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;oct&lt;tag&gt;out=\"october\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;nov&lt;tag&gt;out=\"november\";&lt;\/tag&gt;&lt;\/item&gt;\n             &lt;item&gt;dec&lt;tag&gt;out=\"december\";&lt;\/tag&gt;&lt;\/item&gt;\n           &lt;\/one-of&gt;\n       &lt;\/rule&gt;\n\n        &lt;rule id=\"digits\"&gt;\n            &lt;one-of&gt;\n                &lt;item&gt;0&lt;tag&gt;out=0;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;1&lt;tag&gt;out=1;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;2&lt;tag&gt;out=2;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;3&lt;tag&gt;out=3;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;4&lt;tag&gt;out=4;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;5&lt;tag&gt;out=5;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;6&lt;tag&gt;out=6;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;7&lt;tag&gt;out=7;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;8&lt;tag&gt;out=8;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;9&lt;tag&gt;out=9;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;first&lt;tag&gt;out=1;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;second&lt;tag&gt;out=2;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;third&lt;tag&gt;out=3;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;fourth&lt;tag&gt;out=4;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;fifth&lt;tag&gt;out=5;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;sixth&lt;tag&gt;out=6;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;seventh&lt;tag&gt;out=7;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;eighth&lt;tag&gt;out=8;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;ninth&lt;tag&gt;out=9;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;one&lt;tag&gt;out=1;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;two&lt;tag&gt;out=2;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;three&lt;tag&gt;out=3;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;four&lt;tag&gt;out=4;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;five&lt;tag&gt;out=5;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;six&lt;tag&gt;out=6;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;seven&lt;tag&gt;out=7;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;eight&lt;tag&gt;out=8;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;nine&lt;tag&gt;out=9;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;\/one-of&gt;\n        &lt;\/rule&gt;\n\n\n      &lt;rule id=\"at\"&gt;\n        &lt;tag&gt;out.new=\"\"&lt;\/tag&gt;\n        &lt;item&gt;at&lt;\/item&gt;\n        &lt;one-of&gt;\n          &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#digits\"\/&gt;&lt;tag&gt;out.new+= rules.digits&lt;\/tag&gt;&lt;\/item&gt;\n          &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#teens\"\/&gt;&lt;tag&gt;out.new+= rules.teens&lt;\/tag&gt;&lt;\/item&gt;\n        &lt;\/one-of&gt;\n      &lt;\/rule&gt;\n\n      &lt;rule id=\"mins\"&gt;\n        &lt;tag&gt;out.min=\"\"&lt;\/tag&gt;\n        &lt;item repeat=\"0-1\"&gt;:&lt;\/item&gt;\n        &lt;item repeat=\"0-1\"&gt;and&lt;\/item&gt;\n        &lt;one-of&gt;\n          &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#digits\"\/&gt;&lt;tag&gt;out.min+= rules.digits&lt;\/tag&gt;&lt;\/item&gt;\n          &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#teens\"\/&gt;&lt;tag&gt;out.min+= rules.teens&lt;\/tag&gt;&lt;\/item&gt;\n          &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#above_twenty\"\/&gt;&lt;tag&gt;out.min+= rules.above_twenty&lt;\/tag&gt;&lt;\/item&gt;\n        &lt;\/one-of&gt;\n      &lt;\/rule&gt;\n\n      &lt;rule id=\"ampm\"&gt;\n            &lt;tag&gt;out=\"\"&lt;\/tag&gt;\n            &lt;one-of&gt;\n                &lt;item&gt;AM&lt;tag&gt;out=\"am\";&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;PM&lt;tag&gt;out=\"pm\";&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;am&lt;tag&gt;out=\"am\";&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;pm&lt;tag&gt;out=\"pm\";&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;\/one-of&gt;\n        &lt;\/rule&gt;\n\n\n        &lt;rule id=\"teens\"&gt;\n            &lt;one-of&gt;\n                &lt;item&gt;ten&lt;tag&gt;out=10;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;tenth&lt;tag&gt;out=10;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;eleven&lt;tag&gt;out=11;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;twelve&lt;tag&gt;out=12;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;thirteen&lt;tag&gt;out=13;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;fourteen&lt;tag&gt;out=14;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;fifteen&lt;tag&gt;out=15;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;sixteen&lt;tag&gt;out=16;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;seventeen&lt;tag&gt;out=17;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;eighteen&lt;tag&gt;out=18;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;nineteen&lt;tag&gt;out=19;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;tenth&lt;tag&gt;out=10;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;eleventh&lt;tag&gt;out=11;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;twelveth&lt;tag&gt;out=12;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;thirteenth&lt;tag&gt;out=13;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;fourteenth&lt;tag&gt;out=14;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;fifteenth&lt;tag&gt;out=15;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;sixteenth&lt;tag&gt;out=16;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;seventeenth&lt;tag&gt;out=17;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;eighteenth&lt;tag&gt;out=18;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;nineteenth&lt;tag&gt;out=19;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;\/one-of&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"above_twenty\"&gt;\n            &lt;one-of&gt;\n                &lt;item&gt;twenty&lt;tag&gt;out=20;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;item&gt;thirty&lt;tag&gt;out=30;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;\/one-of&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#digits\"\/&gt;&lt;tag&gt;out += rules.digits;&lt;\/tag&gt;&lt;\/item&gt;\n        &lt;\/rule&gt;\n&lt;\/grammar&gt;<\/code><\/pre>\n<\/p><\/div>\n<h3>Using the industry grammar for insurance<\/h3>\n<p>To create the sample bot and add the grammars, perform the following steps. This creates an Amazon Lex bot called <code>InsuranceBot<\/code> and adds the grammars for the insurance domain:<\/p>\n<ol>\n<li>Download the Amazon Lex bot <a href=\"https:\/\/aws-blogs-artifacts-public.s3.amazonaws.com\/artifacts\/ML-8745\/InsuranceLexBot-DRAFT-K21HEKHI3S-LexJson.zip\" target=\"_blank\" rel=\"noopener noreferrer\">definition<\/a>.<\/li>\n<li>On the Amazon Lex console, choose <strong>Actions<\/strong>, then choose<strong> Import<\/strong>.<\/li>\n<li>Choose the <code>InsuranceBot.zip file<\/code> that you downloaded, and choose <strong>Import<\/strong>.<\/li>\n<li>Copy the <a href=\"https:\/\/docs.aws.amazon.com\/lexv2\/latest\/dg\/samples\/insurance-grammars.zip\" target=\"_blank\" rel=\"noopener noreferrer\">grammar XML files<\/a> for insurance, listed in the preceding section.<\/li>\n<li>On the Amazon S3 console, upload the XML files.<\/li>\n<li>Navigate to the slot types on the Amazon Lex console and select the <code>policyID<\/code> slot type so you can associate the <code>ins_policyNumber.grxml<\/code> grammar file.<\/li>\n<li>In the slot type, enter the Amazon S3 link for the XML file and the object key.<\/li>\n<li>Choose <strong>Save slot type<\/strong>.<\/li>\n<\/ol>\n<p>The IAM role used to create the bot must have permission to read files from the S3 bucket.<\/p>\n<ol start=\"9\">\n<li>Repeat steps 6\u20138 for the <code>licensePlate<\/code> slot type (<code>ins_NJ_licensePlateNumber.grxml<\/code>) and <code>dateTime<\/code> slot type (<code>ins_claimDateTime.grxml<\/code>).<\/li>\n<li>After you save the grammars, choose <strong>Build<\/strong>.<\/li>\n<li>Download the insurance <a href=\"https:\/\/aws-blogs-artifacts-public.s3.amazonaws.com\/artifacts\/ML-8745\/InsuranceFlow\" target=\"_blank\" rel=\"noopener noreferrer\">contact flow<\/a> to integrate with the Amazon Lex bot.<\/li>\n<li>On the Amazon Connect console, choose <strong>Contact flows<\/strong>.<\/li>\n<li>In the <strong>Amazon Lex<\/strong> section, and select your Lex bot and make it available for use in the Amazon Connect contact flows.<\/li>\n<li>Select the contact flow to load it into the application.<\/li>\n<li>Test the IVR flow by calling in to the phone number.<\/li>\n<\/ol>\n<h2>Telecom<\/h2>\n<p>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\u2019s request. We use the financial services industry grammars in the following sample conversation:<\/p>\n<p><em>Agent: Welcome to ACME cellular. To get started, can I have the telephone number associated with your account?<\/em><\/p>\n<p><em>User: Yes, it\u2019s 123 456 7890.<\/em><\/p>\n<p><em>IVR: Thanks. How can I help you?<\/em><\/p>\n<p><em>User: I am calling to activate my service.<\/em><\/p>\n<p><em>IVR: Sure. What\u2019s the SIM number on the device?<\/em><\/p>\n<p><em>IVR: 12345ABC<\/em><\/p>\n<p><em>IVR: Ok. And can I have the zip code?<\/em><\/p>\n<p><em>User: 12345<\/em><\/p>\n<p><em>IVR: Great, thank you. The device has been activated.<\/em><\/p>\n<p>The following grammars are supported for telecom: SIM number, device serial number, zip code, phone number, service start date, and ordinals.<\/p>\n<p>Let\u2019s review the sample <a href=\"https:\/\/aws-blogs-artifacts-public.s3.amazonaws.com\/artifacts\/ML-8745\/tel_simNumber.grxml\" target=\"_blank\" rel=\"noopener noreferrer\">SIM number<\/a> grammar. You can refer to the other grammars in the <a href=\"https:\/\/docs.aws.amazon.com\/lexv2\/latest\/dg\/grammar-industry.html\">documentation<\/a>.<\/p>\n<div class=\"hide-language\">\n<pre><code class=\"lang-xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\" ?&gt;\n&lt;grammar xmlns=\"http:\/\/www.w3.org\/2001\/06\/grammar\"\n         xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n         xsi:schemaLocation=\"http:\/\/www.w3.org\/2001\/06\/grammar\n                             http:\/\/www.w3.org\/TR\/speech-grammar\/grammar.xsd\"\n         xml:lang=\"en-US\" version=\"1.0\"\n         root=\"main\"\n         mode=\"voice\"\n         tag-format=\"semantics\/1.0\"&gt;\n\n\n        &lt;!-- Test Cases\n\n        Grammar will support the following inputs:\n\n            Scenario 1:\n                Input: My SIM number is A B C 1 2 3 4\n                Output: ABC1234\n\n            Scenario 2:\n                Input: My SIM number is 1 2 3 4 A B C\n                Output: 1234ABC\n\n            Scenario 3:\n                Input: My SIM number is 1 2 3 4 A B C 1\n                Output: 123ABC1\n        --&gt;\n\n        &lt;rule id=\"main\" scope=\"public\"&gt;\n            &lt;tag&gt;out=\"\"&lt;\/tag&gt;\n            &lt;item&gt;&lt;ruleref uri=\"#alphanumeric\"\/&gt;&lt;tag&gt;out += rules.alphanumeric.alphanum;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#alphabets\"\/&gt;&lt;tag&gt;out += rules.alphabets.letters;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#digits\"\/&gt;&lt;tag&gt;out += rules.digits.numbers&lt;\/tag&gt;&lt;\/item&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"text\"&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#hesitation\"\/&gt;&lt;\/item&gt;\n            &lt;one-of&gt;\n                &lt;item repeat=\"0-1\"&gt;My SIM number is&lt;\/item&gt;\n                &lt;item repeat=\"0-1\"&gt;SIM number is&lt;\/item&gt;\n            &lt;\/one-of&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"hesitation\"&gt;\n          &lt;one-of&gt;\n             &lt;item&gt;Hmm&lt;\/item&gt;\n             &lt;item&gt;Mmm&lt;\/item&gt;\n             &lt;item&gt;My&lt;\/item&gt;\n          &lt;\/one-of&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"alphanumeric\" scope=\"public\"&gt;\n            &lt;tag&gt;out.alphanum=\"\"&lt;\/tag&gt;\n            &lt;item&gt;&lt;ruleref uri=\"#alphabets\"\/&gt;&lt;tag&gt;out.alphanum += rules.alphabets.letters;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#digits\"\/&gt;&lt;tag&gt;out.alphanum += rules.digits.numbers&lt;\/tag&gt;&lt;\/item&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"alphabets\"&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#text\"\/&gt;&lt;\/item&gt;\n            &lt;tag&gt;out.letters=\"\"&lt;\/tag&gt;\n            &lt;tag&gt;out.firstOccurence=\"\"&lt;\/tag&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#digits\"\/&gt;&lt;tag&gt;out.firstOccurence += rules.digits.numbers; out.letters += out.firstOccurence;&lt;\/tag&gt;&lt;\/item&gt;\n            &lt;item repeat=\"1-\"&gt;\n                &lt;one-of&gt;\n                    &lt;item&gt;A&lt;tag&gt;out.letters+='A';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;B&lt;tag&gt;out.letters+='B';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;C&lt;tag&gt;out.letters+='C';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;D&lt;tag&gt;out.letters+='D';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;E&lt;tag&gt;out.letters+='E';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;F&lt;tag&gt;out.letters+='F';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;G&lt;tag&gt;out.letters+='G';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;H&lt;tag&gt;out.letters+='H';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;I&lt;tag&gt;out.letters+='I';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;J&lt;tag&gt;out.letters+='J';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;K&lt;tag&gt;out.letters+='K';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;L&lt;tag&gt;out.letters+='L';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;M&lt;tag&gt;out.letters+='M';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;N&lt;tag&gt;out.letters+='N';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;O&lt;tag&gt;out.letters+='O';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;P&lt;tag&gt;out.letters+='P';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;Q&lt;tag&gt;out.letters+='Q';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;R&lt;tag&gt;out.letters+='R';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;S&lt;tag&gt;out.letters+='S';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;T&lt;tag&gt;out.letters+='T';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;U&lt;tag&gt;out.letters+='U';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;V&lt;tag&gt;out.letters+='V';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;W&lt;tag&gt;out.letters+='W';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;X&lt;tag&gt;out.letters+='X';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;Y&lt;tag&gt;out.letters+='Y';&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;Z&lt;tag&gt;out.letters+='Z';&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;\/one-of&gt;\n            &lt;\/item&gt;\n        &lt;\/rule&gt;\n\n        &lt;rule id=\"digits\"&gt;\n            &lt;item repeat=\"0-1\"&gt;&lt;ruleref uri=\"#text\"\/&gt;&lt;\/item&gt;\n            &lt;tag&gt;out.numbers=\"\"&lt;\/tag&gt;\n            &lt;item repeat=\"1-10\"&gt;\n                &lt;one-of&gt;\n                    &lt;item&gt;0&lt;tag&gt;out.numbers+=0;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;1&lt;tag&gt;out.numbers+=1;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;2&lt;tag&gt;out.numbers+=2;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;3&lt;tag&gt;out.numbers+=3;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;4&lt;tag&gt;out.numbers+=4;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;5&lt;tag&gt;out.numbers+=5;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;6&lt;tag&gt;out.numbers+=6;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;7&lt;tag&gt;out.numbers+=7;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;8&lt;tag&gt;out.numbers+=8;&lt;\/tag&gt;&lt;\/item&gt;\n                    &lt;item&gt;9&lt;tag&gt;out.numbers+=9;&lt;\/tag&gt;&lt;\/item&gt;\n                &lt;\/one-of&gt;\n            &lt;\/item&gt;\n        &lt;\/rule&gt;\n&lt;\/grammar&gt;<\/code><\/pre>\n<\/p><\/div>\n<h3>Using the industry grammar for telecom<\/h3>\n<p>To create the sample bot and add the grammars, perform the following steps. This creates an Amazon Lex bot called <code>TelecomBot<\/code> and adds the grammars for telecom:<\/p>\n<ol>\n<li>Download the Amazon Lex bot <a href=\"https:\/\/aws-blogs-artifacts-public.s3.amazonaws.com\/artifacts\/ML-8745\/TelecomLexBot-DRAFT-OXKVQFYMDP-LexJson.zip\" target=\"_blank\" rel=\"noopener noreferrer\">definition<\/a>.<\/li>\n<li>On the Amazon Lex console, choose <strong>Actions<\/strong>, then choose<strong> Import<\/strong>.<\/li>\n<li>Choose the <code>TelecomBot.zip<\/code> file that you downloaded, and choose <strong>Import<\/strong>.<\/li>\n<li>Copy the <a href=\"https:\/\/docs.aws.amazon.com\/lexv2\/latest\/dg\/samples\/telecom-grammars.zip\" target=\"_blank\" rel=\"noopener noreferrer\">grammar XML files<\/a> for the telecom domain, listed in the preceding section.<\/li>\n<li>On the Amazon S3 console, upload the XML files.<\/li>\n<li>Navigate to the slot types on the Amazon Lex console and select <code>phoneNumber<\/code> so you can associate the <code>tel_phoneNumber.grxml<\/code> grammar.<\/li>\n<li>In the slot type, enter the Amazon S3 link for the XML file and the object key.<\/li>\n<li>Choose <strong>Save slot type<\/strong>.<\/li>\n<\/ol>\n<p>The IAM role used to create the bot must have permission to read files from the S3 bucket.<\/p>\n<ol start=\"9\">\n<li>Repeat steps 6\u20138 for the slot types <code>SIM number<\/code> (<code>tel_simNumber.grxml<\/code>) and <code>zipcode<\/code> (<code>tel_usZipcode.grxml<\/code>).<\/li>\n<li>After you save the grammars, choose <strong>Build<\/strong>.<\/li>\n<li>Download the insurance <a href=\"https:\/\/aws-blogs-artifacts-public.s3.amazonaws.com\/artifacts\/ML-8745\/TelecomFlow\" target=\"_blank\" rel=\"noopener noreferrer\">contact flow<\/a> to integrate with the Amazon Lex bot.<\/li>\n<li>On the Amazon Connect console, choose <strong>Contact flows<\/strong>.<\/li>\n<li>In the <strong>Amazon Lex<\/strong> section, and select your Amazon Lex bot and make it available for use in the Amazon Connect contact flows.<\/li>\n<li>Select the contact flow to load it into the application.<\/li>\n<li>Test the IVR flow by calling in to the phone number.<\/li>\n<\/ol>\n<h2>Test the solution<\/h2>\n<p>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.<\/p>\n<h2>Conclusion<\/h2>\n<p>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 <a href=\"https:\/\/docs.aws.amazon.com\/lexv2\/latest\/dg\/building-srgs.html\" target=\"_blank\" rel=\"noopener noreferrer\">grammar slot type<\/a> 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.<\/p>\n<p>To learn more, refer to <a href=\"https:\/\/docs.aws.amazon.com\/lexv2\/latest\/dg\/building-srgs.html\" target=\"_blank\" rel=\"noopener noreferrer\">Using a custom grammar slot type<\/a>.<\/p>\n<hr>\n<h3>About the Authors<\/h3>\n<p><strong><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/22\/John-Heater-headshot.png\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-34464 alignleft\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2022\/03\/22\/John-Heater-headshot.png\" alt=\"\" width=\"100\" height=\"122\"><\/a>John Heater<\/strong> 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.<\/p>\n<p><strong><a href=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/08\/17\/Sandeep-Srinivasan.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-27294 alignleft\" src=\"https:\/\/d2908q01vomqb2.cloudfront.net\/f1f836cb4ea6efb2a0b1b99f41ad8b103eff4b59\/2021\/08\/17\/Sandeep-Srinivasan.jpg\" alt=\"\" width=\"100\" height=\"106\"><\/a>Sandeep Srinivasan<\/strong> 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.<\/p>\n<p>       <!-- '\"` -->\n      <\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/aws.amazon.com\/blogs\/machine-learning\/expedite-ivr-development-with-industry-grammars-on-amazon-lex\/<\/p>\n","protected":false},"author":0,"featured_media":2005,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/2004"}],"collection":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/comments?post=2004"}],"version-history":[{"count":0,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/posts\/2004\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media\/2005"}],"wp:attachment":[{"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/media?parent=2004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/categories?post=2004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/salarydistribution.com\/machine-learning\/wp-json\/wp\/v2\/tags?post=2004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}