Reader small image

You're reading from  Practical Guide to Azure Cognitive Services

Product typeBook
Published inMay 2023
PublisherPackt
ISBN-139781801812917
Edition1st Edition
Right arrow
Authors (3):
Chris Seferlis
Chris Seferlis
author image
Chris Seferlis

Chris Seferlis is an Account Technology Strategist at Microsoft. He has over 20 years of experience working in IT and solving technology challenges to accomplish business goals. Chris has an MBA from UMass, bringing a mix of business acumen, with practical technology solutions, focusing on the Microsoft Data Platform and Azure.
Read more about Chris Seferlis

Christopher Nellis
Christopher Nellis
author image
Christopher Nellis

Christopher Nellis is a Senior Infrastructure Engineer and is experienced in deploying large-scale infrastructure for organizations. He has a passion for automation and MLOps and enjoys working with people to solve problems and make things better.
Read more about Christopher Nellis

Andy Roberts
Andy Roberts
author image
Andy Roberts

Andy Roberts is a seasoned Data Platform and AI Architect. He has dawned many hats in his career as a developer, dba, architect, project lead, or more recently a part of a sales organization, the heart of his job has always revolved around data. Acquiring it, shaping it, moving it, protecting it and using it to predict future outcomes, processing it efficiently.
Read more about Andy Roberts

View More author details
Right arrow

Using Language Services in Chat Bots and Beyond

Are chat bots a function of corporate America, stripping out costs and assuming humans are content interacting with anyone, human or synthetic? Are they a way to remove initial barriers and understand customers’ requirements without requiring interaction by humans? Because Ocean Smart puts such a focus on customer service, there was significant hesitation in deploying a chat bot as the initial interaction point for their customers. However, with the potential cost savings and the ability to include translation and content moderation by combining multiple Azure Cognitive Services, the benefits of deploying the technology outweighed the negative aspects.

In this chapter, we will explore how Ocean Smart was able to leverage and combine these Cognitive Services to enhance the global customer experience and save some costs by no longer using human beings as the initial point of contact for customer service. To further improve the...

Technical requirements

To build our bot, we will use Bot Framework Composer version 2.x, which you can download from https://learn.microsoft.com/en-us/composer/install-composer?tabs=windows#download-composer.

Bot Framework Composer is available on Windows, Mac, and Linux and has two pre-requisites:

Bot Framework Composer will build a C# project behind the scenes and deploy it to our Azure subscription. If you would like to view the C# project, you can use Visual Studio Code or Visual Studio 2022 Community Edition, which you can find at https://visualstudio.microsoft.com/vs/community.

Using a chat bot for enhanced customer service

In the past, various organizations prided themselves on providing the utmost satisfaction possible when talking about customer service for their products or services. Of course, the old adage “the customer is always right” came into play for some of these organizations, but whether they make the investments necessary to truly embody that statement is a whole other discussion. You see, the drawback to investments in customer service representatives and all other investments relating to this area is that they don’t have tangible revenue increases that can be directly tied to a good customer experience.

The value provided is often peripheral, and it is difficult to measure exactly how much investment should be made to positively impact revenue without overspending in this area, where the investment becomes wasted. Organizations that don’t put quite as much of an investment in this area intentionally are deciding...

Tying the Cognitive Service for Language to the chat bot for NLP

One of the first ways we can enhance our bot experience is by changing the conversation, literally, to interpretation, enabling us to shift from a contextual understanding to a conversational understanding. As we will display later in the chapter with our working example from Ocean Smart, this can apply to a customer checking on the status of an order, or a whole other host of options. To understand what challenge our customer is having, we ask for the order number to check on the status, but without the Conversational Language Understanding (CLU) capability of the Cognitive Service for Language, the bot would just see a sequence of numbers and letters. Of course, with no other understanding, the bot would be stuck without knowing what the number was or how to handle it.

Initially, these Language Understanding capabilities were handled by the Azure Language Understanding Service (LUIS), but it was announced that this...

Using the translator services for worldwide solutions

As we discussed in the previous section, we have significant capabilities within Language Services to create a custom model with entities and intents, to respond to our consumers in an intelligent fashion. It is a complicated process to plan and deploy a bot with this intelligence because you need to be able to predict what a consumer might ask for help with, or else divert them to customer service via email or the phone. That can be an arduous process, but what happens when your bot or other application needs to interact with consumers who are not using the primary language that you have developed? Well, the CLU has options for handling just these scenarios by providing multilingual projects.

With multilingual projects, we can work with several languages by providing utterances in different languages, associated with entities and intents for each of those languages. However, the real value of using multilingual projects is that...

Advanced capabilities of Language Understanding

Since the LUIS service has transitioned to the CLU and the broader Language Services under the Cognitive Services umbrella, Microsoft has been able to ascertain a better understanding of how customers use the service for quite some time. The result of these details has given Microsoft the ability to add advanced features that customers can leverage, adding more capability to their projects as well as additional features. Here, we will briefly discuss some of the advanced features that may be beneficial for your project as well.

Orchestration workflow

In the previous section, we discussed how the CLU can support multilingual projects as well as deploy them to multiple regions, and these options have evolved significantly over time. Another key element developed is the ability to work with multiple projects in sequence with the orchestration workflow tools, adding the ability to tie projects together for more advanced capabilities...

Building a bot using language Understanding

One area where we see Language Services used frequently is chat bots. In this chapter, we will use Bot Framework Composer to build a chat that calls LUIS. We will use this solution as the application for our previous example of the Content Moderator service from Chapter 11.

LUIS is the precursor to the Language Service described in this chapter. At the time of writing, Bot Framework still uses LUIS, and there should be a new version of Bot Framework that supports the Language Service in the coming months.

Figure 14.9 – A diagram of the services and data flow that use Bot Framework and LUIS

Figure 14.9 – A diagram of the services and data flow that use Bot Framework and LUIS

So, let’s jump in and get started on creating the project to build our bot.

Creating our bot project

When you launch the Bot Framework Composer application, you will come to a welcome page:

  1. Let’s start by creating a new project, as shown in the following screenshot:
Figure 14.10 – Bot Framework Composer – the Create new project dialog ...

Summary

The bot framework is a common host to access LUIS and, in the future, Language Services. As we have seen throughout the chapter, Bot Framework, the Composer and Cognitive Services offer a powerful solution when paired together. Now that we have provided a base example, you can evolve this solution to do things such as extract entities from trigger text. Instead of “Check my order,” maybe the user will say, “What is the status of order 12345?” We can extract the order number from the utterance using language entities. You can also hook the Bot Framework Composer up to external data sources, as we did with the Content Moderator, and communicate on various channels such as Microsoft Teams, Facebook, and text messaging, which we covered in Chapter 11. Further, as described, there are many other use cases the Language Services can assist you with when looking to optimize operations and improve customer service.

Here, we’ve covered many of the...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Practical Guide to Azure Cognitive Services
Published in: May 2023Publisher: PacktISBN-13: 9781801812917
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Authors (3)

author image
Chris Seferlis

Chris Seferlis is an Account Technology Strategist at Microsoft. He has over 20 years of experience working in IT and solving technology challenges to accomplish business goals. Chris has an MBA from UMass, bringing a mix of business acumen, with practical technology solutions, focusing on the Microsoft Data Platform and Azure.
Read more about Chris Seferlis

author image
Christopher Nellis

Christopher Nellis is a Senior Infrastructure Engineer and is experienced in deploying large-scale infrastructure for organizations. He has a passion for automation and MLOps and enjoys working with people to solve problems and make things better.
Read more about Christopher Nellis

author image
Andy Roberts

Andy Roberts is a seasoned Data Platform and AI Architect. He has dawned many hats in his career as a developer, dba, architect, project lead, or more recently a part of a sales organization, the heart of his job has always revolved around data. Acquiring it, shaping it, moving it, protecting it and using it to predict future outcomes, processing it efficiently.
Read more about Andy Roberts