(bright music)
- Welcome back to Azure AI Essentials.
In this video,
I'll show you how to build chatbots on Azure.
Chatbots are useful in a variety of scenarios.
Simple informational chatbots
can be used to handle a large volume
of frequently asked questions.
Converting FAQ content
into a conversational experience
can help your employees and customers
quickly get the information they need.
In the case of the CDC,
they built this type of chatbot
to help people self check symptoms for COVID-19.
Next, we have transactional chatbots
that are used to empower end users to self serve.
Take for instance,
a customer who wants to place an order
and later get an updated order status.
This requires the chatbot to retrieve
and sometimes edit records in your existing IT systems.
For example, UPS built a chatbot to enable customers
to self serve and get a status on their packages.
Finally, dynamic and contextual bots
are even more sophisticated.
These chatbots are context aware,
and can do things on your behalf
that make you more productive,
like make reservations,
update your calendar or to do list,
make recommendations and more.
A great example is Universal Electronics,
which built a voice-enabled virtual assistant
to help customers control their smart homes.
Next, I'll walk you through the tools you can use
to build these types of chatbots on Azure.
Let's start with a simple informational q&a bot.
This type of chatbot can help organizations scale
to more easily answer frequently asked questions,
while enabling specialist resources
to handle more nuanced requests.
In addition to the CDC,
another example is Accenture,
who built a chatbot
to help answer common onboarding requests
from new employees.
Other common use cases
include IT help desk password resets,
and customer service FAQs.
The fastest way to build this type of chatbot
is to use QnA Maker,
an Azure cognitive service,
which helps developers quickly convert information
into a question and answer conversational experience.
If you already have an FAQ document or product manual,
all you need to do is upload the document
or paste the page URL within the QnA Maker portal.
You can test the chatbot, edit the q&a pairings,
and add new ones within the QnA Maker portal.
You can also add alternative phrases,
which are additional examples
of how a user might ask the same question,
which helps increase the accuracy of the answers returned.
Inevitably, users will ask questions
outside the scope of the chatbot.
To help you address these questions,
QnA Maker offers thousands of small talk questions
in five different personas
to help match the personality of your bot.
When configuring a bot in the QnA Maker portal,
you can select one of these personas
to handle questions like,
tell me a joke, or when's your birthday?
These informational chatbots
can be really helpful to answer inquiries
from employees or customers.
However, chatbots are capable
of handling more complex scenarios,
including allowing users to self serve,
to retrieve and edit information in a database.
Chatbots can be created
to handle sophisticated scenarios.
For example, Progressive lets users
generate an insurance quote
just by chatting with their bot, Flo.
In the next few minutes,
we'll cover key steps to build more advanced chatbots,
including transactional chatbots,
as well as dynamic context aware chatbots.
The Azure services will cover our Bot Framework,
Azure Cognitive Services and Azure Bot Service.
And our example today is an internal HR vacation bot,
which helps employees
with tasks like checking
how many vacation days they have left and booking vacation.
For no-code, out-of-the-box solution
for business users to build a chatbot,
we also offer Power Virtual Agents,
a SaaS offering built on top of the Bot Framework.
So let's dive in.
The first step is to build the chatbot application
using the Bot Framework,
an open-source SDK and set of tools available on GitHub
to help developers design, build, test, publish
and connect their bots to their end users.
The Bot Framework SDK
offers a code first bot development experience available
in C#, Node, Python and Java
with bot templates and samples available
in the Bot Framework GitHub repo.
So you can build using your preferred tools and IDEs.
In addition to the SDK,
you can use the Bot Framework Composer,
a visual tool for building chatbots,
which we'll use in our example.
It lets you accelerate the bot development process
by allowing you to focus on the dialogue authoring.
Rather than creating a bot from scratch.
You'll start by creating a new project
in Bot Framework Composer.
On the left, you have a list of triggers,
which are used to respond to external events,
like a message being received from a user.
Here, we start with a built in greeting trigger,
which is the bots response
to a user joining the conversation.
A subsequent trigger might be a user question,
and you can edit what your bot will say in response,
you can create a new trigger
and provide example phrases mapping
to that user intent.
Here we're adding phrases indicating
that a user wants to book a vacation,
and behind the scenes, Composer is automatically
creating a natural language processing model
to understand user intent
using Azure Cognitive Services.
You can then build out the dialogue
using the authoring canvas,
giving the bot the ability to reply back or take action
based on what the user says.
For a conversation that feels natural,
you can give your bot a choice of phrases to choose from
for its response.
You can also store a user's response
as a variable and add that user input
into the bot's response later in the dialogue.
Here, the user gives a reason
for wanting to book a vacation,
and the bot can refer to that reason later
in the conversation.
Once you've built your bot application,
you can improve your user experience
by adding intelligence to your bot.
With Azure Cognitive Services capabilities
across vision, speech, language and decision.
Language and speech capabilities
are the most commonly added to bots.
In fact, you can use these services directly
from within the Bot Framework.
For example, the speech service can be integrated
into your bot via the direct line channel
and Azure bot service.
So you can enable voice interactions
like transcribing speech to text,
creating a custom keyword,
and adding text to speech capabilities
with support to create a custom voice for your bot.
Additionally, the language understanding service
used to understand your users' intents and QnA Maker,
which we discussed earlier,
can be used directly within Bot Framework Composer.
Let's see this in action.
To enable this bot to answer FAQs,
Composer can use the QnA Maker service
to create a knowledge base for you.
And you can edit
the question and answer pairs directly in Composer.
Going back to the design page,
you can see that there's a new q&a trigger,
which fires when an incoming user request matches an answer
in the knowledge base.
This bot is also using language understanding.
So you'll need to create a cognitive services resource.
When you're ready to test and publish your bot.
you'll add the authoring key
which you can find in the Azure portal
where you'll create your resource.
When you do this,
Composer will create and publish a Lewis model for you.
Speaking of testing,
now that you've built the bot application
with Bot Framework,
and added AI models with cognitive services,
you're ready to test your bot.
If you use the SDK and code-first tools,
you can run the app locally
in Visual Studio or the IDE of choice.
If you use the Composer,
you can use the Bot Framework emulator,
simply click test in emulator
and test your bot from there.
You'll see your welcome message
because your greeting trigger
was fired when the conversation started,
and you can begin testing your chatbot.
Additionally, you can add context awareness
by building skills to extend your bot further,
we have a set of Bot Framework skills
to get you started,
including a calendar skill to schedule meetings,
a to do skill to manage task lists,
a weather skill for information on local weather,
a point of interest skill to incorporate maps,
information and more.
One thing to note is that each skill comes
with a pre-trained language model
for that specific scenario.
But you can still further customize these models
to understand intents and entities.
Once you're done testing your bot,
you can publish it to Azure using Azure Bot Service,
which will host your bot and connect it to popular channels.
You can surface your bot
through several different channels
including Microsoft Teams, Slack, Facebook Messenger,
Amazon Alexa and more.
To publish your bot to Azure Bot Service,
you'll create a new Publish Profile
and then deploy either to an Azure web app
or an Azure function.
Then you can navigate to the Azure portal
and test to make sure that your deployed bot
is working correctly.
Now you can connect to the channel of your choice.
Here we're publishing to Microsoft Teams,
and the vacation bot is now ready
to help employees book vacation
and answer frequently asked questions.
There are so many ways you can use bots
to help provide useful and engaging experiences
for your customers and employees,
from providing an efficient way to get crucial information
to helping complete tasks to enhancing productivity.
We hope you found this video useful
and we look forward
to seeing the conversational AI solutions
you build on Azure.
(bright music)