Join me on my ML Journey from novice to expert! with some nomadic meanderings along the way.

Amazon AWS, Machine Learning

Creating a sophisticated conversational experience using Amazon Lex in Australian English

Creating a sophisticated conversational experience using Amazon Lex in Australian English

Amazon Lex is a service for building conversational interfaces into any application using voice and text. To build truly engaging conversational experiences, you need high quality speech recognition and natural language understanding that understands the intent of the customer accurately.

We are excited to announce that Amazon Lex now supports Australian English. With Australian English, you can deliver a robust and localized conversational experience that accurately understands the Australian dialect. You can also respond to users with natural sounding Amazon Polly Australian voices to provide a fully localized conversational experience.

This post shows how you can build a bot with Australian English support and use the pre-defined built-ins to deliver a superior experience to your users.

Building an Amazon Lex bot

This post uses the following conversation to model a bot:

User: I’d like to schedule an appointment for a dishwasher repair.
Agent: Sure, what city are you in?
User: Ballarat.
Agent: Got it. And what’s the serial number?
User: 1234.
Agent: Ok. For that model, I have technicians available next week. When would you prefer to have them visit?
User: Can I get someone on 4/9?
Agent: Sure. You are all set for September 4th.
User: Thanks!

The first step is to build an Amazon Lex bot with intents to manage appointments. The ScheduleAppointment, ModifyAppointment, and CancelAppointment intents provide this capability. You can download a sample bot definition to follow along with this post.

Creating a bot in Australian English

For this post, you will create an Amazon Lex bot called AppointmentBot. Alternatively, you can also import the sample bot directly and skip the bot creation process.

  1. Open the AWS console, and make sure you have selected the Asia Pacific (Sydney)/ap-southeast-2 region.
  2. Go to the Amazon Lex console. On the Bots tab, choose Create.
  3. Select Custom Bot.
  4. Enter the Bot name and select English (AU) as Language.
  5. Select the Output voice. The list of voices are specific to the language selected for the bot.  
  6. Specify Sentiment analysis, Session timeout, and COPPA settings.
  7. Choose Create.
  8. Once the bot is created, create ScheduleAppointment, ModifyAppointment, and CancelAppointment intents for your bot by adding sample utterances and slot values.
  9. Select Build.

At this point, you should have a working Lex bot.

Setting up an Amazon Connect flow

In this section, we deploy the bot in an Amazon Connect Interactive Voice Response (IVR).

Creating your Amazon Connect instance

In this first step, you create your Amazon Connect instance:

  1. On the AWS Management Console, choose Amazon Connect.
  2. If this is your first Amazon Connect instance, choose Get started; otherwise, choose Add an instance.
  3. For Identity management, choose Store users within Amazon Connect.
  4. Enter a URL prefix such as test-instance-############, where “############” is your current AWS account number.
  5. Choose Next step.
  6. For Create an administrator, enter a name, password, and email address.
  7. Choose Next step.
  8. For Telephony Options, leave both call options selected by default.
  9. Choose Next step.
  10. For Data storage, choose Next step.
  11. Review the settings and choose Create instance.
  12. After your instance is created, choose Get started.

Associating your bot with your Amazon Connect instance

Now that you have an Amazon Connect instance, you can claim a phone number, create a contact flow, and integrate with the AppointmentBot Lex bot you created in the prior step. First, associate your bot with your Amazon Connect instance:

  1. On the Amazon Connect console, open your instance by choosing the Instance Alias
  2. Choose Contact flows.
  3. From the drop-down list, choose AppointmentBot. If you don’t see the bot in the list, make sure you have selected the same Region you used when you created your Lex bot.
  4. Choose + Add Lex Bot.

Configuring Amazon Connect to work with your bot

Now you can use your bot with Amazon Connect.

  1. On the Amazon Connect dashboard, for Step 1, Choose Begin.
  2. For your phone number, choose Australia for the country, Direct Dial or Toll Free, and choose a phone number.
  3. Choose Next.
  4. If you want to test your new phone number, try it on the next screen or choose Skip for now.

For this post, you can skip hours of operation, creating queues, and creating prompts. For more information on these features, see the Amazon Connect Administrator Guide.

  1. For Step 5, Create contact flows, choose View contact flows.
  2. Choose Create contact flow.
  3. Change the name of the contact flow to Manage repairs.
  4. From the Set drop-down menu, drag a Set voice card to the contact flow canvas. Open the card and change the Language to “English (Australian)”, choose an available Voice, and choose Save.
  5. Drag a connector from the Entry point card to your new Set voice card.
  6. From the Interact drop-down menu, drag a Play prompt card to the contact flow canvas.
  7. In the Play prompt details, choose Text-to-speech or chat text.
  8. In the text box, enter Hi. How can I help? You can schedule or change a repair appointment.
  9. Choose Save.
  10. Drag a connector from the Set voice card to your new Play prompt card.
  11. Drag a Get customer input card to the contact flow canvas.
  12. In the Get customer input details, choose Text-to-speech or chat text.
  13. In the text box, enter What would you like to do?
  14. Choose Amazon Lex, and choose the AppointmentBot bot in the drop-down list.
  15. Add each AppointmentBot intent to the contact flow: ScheduleAppointment, ModifyAppointment, CancelAppointment, and Disconnect.
  16. Choose Save.
  17. Drag a connector from the Play prompt card to the Get customer input
  18. Drag a Play prompt card to the contact flow.
  19. Choose Text-to-speech or chat text.
  20. In the text box, enter Is there anything else I can help you with?
  21. Choose Save.
  22. Drag connectors for each entry (except for Disconnect) in the Get customer input card to the new Play prompt card.
  23. Drag a connector from the new Play prompt card back to the Get customer input card.
  24. From the Terminate/Transfer drop-down menu, and drag a Disconnect/Hang up card to the contact flow.
  25. Drag a connector from the Disconnect entry in the Get customer input card to the Disconnect/Hang up card.

Your contact flow should look something like the following image.

  1. Choose Save to save your contact flow.
  2. Choose Publish to make your new contact flow available to your callers.
  3. Choose the Dashboard icon from the side menu.
  4. Choose Dashboard.
  5. Choose View phone numbers.
  6. Choose your phone number to edit it, and change the contact flow or IVR to the Manage Repairs contact flow you just created. Choose Save.

Your Amazon Connect instance is now configured to work with your Amazon Lex bot. Try calling the phone number to see how it works.

Conclusion

Conversational experiences are vastly improved when you understand your user’s accent and respond in a style familiar to them. With Australian English support on Amazon Lex, you can now build bots that are better at understanding the Australian English accent. You can also use pre-defined slots to capture local information such as names and cities. Australian English allows you deliver a robust and localized conversational experience to your users in the Australia region. Australian English is available at the same price, and in the same Regions, as US English. You can try Australian English via the console, the AWS Command Line Interface (AWS CLI), and the AWS SDKs. Start building your Aussie bot today!


About the Authors

Brian Yost is a Senior Consultant with the AWS Professional Services Conversational AI team. In his spare time, he enjoys mountain biking, home brewing, and tinkering with technology.

 

 

 

Anubhav Mishra is a Product Manager with AWS. He spends his time understanding customers and designing product experiences to address their business challenges.

Leave a Reply