Customer service calls require customer agents to have the customer’s account information to process the caller’s request. For example, to provide a status on an insurance claim, the support agent needs policy holder information such as the policy ID and claim number. Such information is often collected in the interactive voice response (IVR) flow at the beginning of a customer support call. IVR systems have typically used grammars based on the Speech Recognition Grammar Specification (SRGS) format to define rules and parse caller information (policy ID, claim number). You can now use the same grammars in Amazon Lex to collect information in a speech conversation. You can also provide semantic interpretation rules using ECMAScript tags within the grammar files. The grammar support in Amazon Lex provides granular control for collecting and postprocessing user input so you can manage an effective dialog.
In this post, we review the grammar support in Amazon Lex and author a sample grammar for use in an Amazon Connect contact flow.
Use grammars to collect information in a conversation
You can author the grammar as a slot type in Amazon Lex. First, you provide a set of rules in the SRGS format to interpret user input. As an optional second step, you can write an ECMA script that transforms the information collected in the dialog. Lastly, you store the grammar as an XML file in an Serviciul Amazon de stocare simplă (Amazon S3) bucket and reference the link in your bot definition. SRGS grammars are specifically designed for voice and DTMF modality. We use the following sample conversations to model our bot:
Conversația 1
IVR: Hello! How can I help you today?
User: I want to check my account balance.
IVR: Sigur. Ce cont ar trebui să scot?
User: Checking.
IVR: Care este numărul de cont?
User: 1111 2222 3333 4444
IVR: For verification purposes, what is your date of birth?
User: Jan 1st 2000.
IVR: Thank you. The balance on your checking account is $123 dollars.
Conversația 2
IVR: Hello! How can I help you today?
User: I want to check my account balance.
IVR: Sigur. Ce cont ar trebui să scot?
User: Savings.
IVR: Care este numărul de cont?
User: I want to talk to an agent.
IVR: Ok. Let me transfer the call. An agent should be able to help you with your request.
In the sample conversations, the IVR requests the account type, account number, and date of birth to process the caller’s requests. In this post, we review how to use the grammars to collect the information and postprocess it with ECMA scripts. The grammars for account ID and date cover multiple ways to provide the information. We also review the grammar in case the caller can’t provide the requested details (for example, their savings account number) and instead opts to speak with an agent.
Build an Amazon Lex chatbot with grammars
We build an Amazon Lex bot with intents to perform common retail banking functions such as checking account balance, transferring funds, and ordering checks. The CheckAccountBalance
intent collects details such as account type, account ID, and date of birth, and provides the balance amount. We use a grammar slot type to collect the account ID and date of birth. If the caller doesn’t know the information or asks for an agent, the call is transferred to a human agent. Let’s review the grammar for the account ID:
The grammar has two rules to parse user input. The first rule interprets the digits provided by the caller. These digits are appended to the output via an ECMA script tag variable (out
). The second rule manages the dialog if the caller wants to talk to an agent
. În acest caz out
tag is populated with the word agent. After the rules are parsed, the out tag carries the account number (out.AccountNumber
) or the string agent
. The downstream business logic can now use the out
tag handle the call.
Implementați exemplul de bot Amazon Lex
Pentru a crea eșantionul bot și pentru a adăuga gramaticile, efectuați următorii pași. Acest lucru creează un bot Amazon Lex numit BankingBot
, and two grammar slot types (accountNumber
, dateOfBirth
).
- Descărcați Botul Amazon Lex.
- În consola Amazon Lex, alegeți Acţiuni, Apoi alegeți Import.
- Alegeți fișierul
BankingBot.zip
pe care l-ați descărcat și alegeți Import. In the IAM Permissions section, for Runtime role, choose Creați un nou rol with basic Amazon Lex permissions. - Alegeți botul
BankingBot
pe consola Amazon Lex. - Download the XML files for accountNumber și dateOfBirth. (Note: In some browsers you will have to “Save the link” to download the XML files)
- Pe consola Amazon S3, încărcați fișierele XML.
- Navigate to the slot types on the Amazon Lex console, and click on the
accountNumber
tip slot - In the slot type grammar select the S3 bucket with the XML file and provide the object key. Click on Salvați tipul slotului.
- Navigate to the slot types on the Amazon Lex console, and click on the
dateOfBirth
tip slot - In the slot type grammar select the S3 bucket with the XML file and provide the object key. Click on Salvați tipul slotului.
- After the grammars are saved, choose Construi.
- Descărcați suportul AWS Lambdas and Navigate to the AWS Lambda console.
- On the create function page select Autor de la zero. As basic information please provide the following: numele funcției
BankingBotEnglish
, și RuntimePython 3.8
. - Faceţi clic pe Creați funcția. In the Code source section, open
lambda_funciton.py
și șterge the existing code. Descarcă the code and open it in a text editor. Copiați și lipi the code into the emptylambda_funciton.py
tab. - Alege disloca.
- Navigate to the Amazon Lex Console and select
BankingBot
. Faceţi clic pe Implementare și apoi Pseudonime urmată deTestBotAlias
- Pe Pseudonime page select limbi și navigați la Engleză (US).
- Pentru sursă selecta
BankingBotEnglish
, Pentru Versiune lambda sau alias selecta$LATEST
- Navigate to the Amazon Connect console, choose Fluxuri de contact.
- Descărcați fluxul de contact pentru a se integra cu robotul Amazon Lex.
- În secțiunea Amazon Lex, selectați botul dvs. Amazon Lex și puneți-l disponibil pentru utilizare în fluxurile de contact Amazon Connect.
- Selectați fluxul de contacte pentru a-l încărca în aplicație.
- Make sure the right bot is configured in the “Get Customer Input” block. Add a phone number to the contact flow.
- Alegeți o coadă în blocul „Setare coadă de lucru”.
- Testați fluxul IVR sunând la numărul de telefon.
- Test the solution.
Testați soluția
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 and DTMF.
Concluzie
Custom grammar slots provide the ability to collect different types of information in a conversation. You have the flexibility to capture transitions such as handover to an agent. Additionally, you can postprocess the information before running the business logic. You can enable grammar slot types via the Amazon Lex V2 console or AWS SDK. The capability is available in all AWS Regions where Amazon Lex operates in the English (Australia), English (UK), and English (US) locales.
Pentru a afla mai multe, consultați Folosind un tip de slot gramatical personalizat. You can also view the Amazon Lex documentation for SRGS or ECMAScript pentru mai multe informatii.
Despre Autori
Kai Loreck este un consultant profesional pentru servicii Amazon Connect. Lucrează la proiectarea și implementarea soluțiilor scalabile pentru experiența clienților. În timpul liber, el poate fi găsit făcând sporturi, snowboarding sau drumeții în munți.
Harshal Pimpalkhute is a Product Manager on the Amazon Lex team. He spends his time trying to get machines to engage (nicely) with humans.
- Coinsmart. Cel mai bun schimb de Bitcoin și Crypto din Europa.
- Platoblockchain. Web3 Metaverse Intelligence. Cunoștințe amplificate. ACCES LIBER.
- CryptoHawk. Radar Altcoin. Încercare gratuită.
- Source: https://aws.amazon.com/blogs/machine-learning/interpret-caller-input-using-grammar-slot-types-in-amazon-lex/
- "
- 100
- 9
- Cont
- agenţi
- TOATE
- Amazon
- sumă
- aplicație
- Australia
- disponibil
- AWS
- Bancar
- Început
- Bloca
- Bot
- construi
- afaceri
- apel
- apelant
- captura
- control
- Verificări
- Alege
- cod
- colecta
- Colectare
- Comun
- Consoleze
- consultant
- contactați-ne
- Control
- Conversație
- conversații
- creează
- personalizat
- experienta clientului
- Relații Clienți
- proiect
- diferit
- cifre
- direct
- Nu
- de dolari
- editor
- Eficace
- permite
- Engleză
- exemplu
- Ieşire
- experienţă
- First
- Flexibilitate
- debit
- următor
- format
- găsit
- funcţie
- Fondurile
- ajutor
- Cum
- Cum Pentru a
- HTTPS
- uman
- Oamenii
- informații
- intrare
- asigurare
- integra
- scop
- interactiv
- IT
- Cheie
- limbă
- AFLAȚI
- LINK
- încărca
- Masini
- manager
- model
- mai mult
- multiplu
- număr
- deschide
- Punct
- Politica
- proces
- Produs
- profesional
- furniza
- furnizează
- public
- scopuri
- solicita
- cereri de
- necesita
- răspuns
- cu amănuntul
- revizuiască
- Traseul
- norme
- funcţionare
- scalabil
- sdk
- serviciu
- Servicii
- set
- simplu
- So
- soluţie
- soluţii
- unele
- specific
- Sportul
- Începe
- Stare
- depozitare
- stoca
- a sustine
- De sprijin
- sisteme
- Vorbi
- echipă
- test
- timp
- astăzi
- transfer
- transferat
- transferare
- tipic
- Uk
- us
- utilizare
- Verificare
- Vizualizare
- Voce
- W3
- Ce
- Ce este
- în
- de lucru
- fabrică
- XML