This document provides an overview of how to build a chatbot from scratch, including various examples of existing chatbots and their business models. It discusses the key components needed to build a chatbot using the Bot Framework SDK, including natural language processing with LUIS and storing FAQs with QnA Maker. The document also covers best practices for testing, deploying, and monitoring chatbots to ensure high quality user experiences.
21. The Bot Framework Emulator is a desktop application that allows bot
developers to test and debug their bots on localhost or running remotely
through a tunnel.
22.
23.
24. When you finish writing your bot, you need to
• Register the bot to generate the bot’s app ID and password
• connect the bot to channels of your choice
• and (optionally) publish it.
25.
26. If you're running your bot behind a firewall or other network boundary and
want to connect to an external channel, you will need to install and configure
tunneling software (i.e. ngrok).
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40. Many messaging channels provide the ability to attach richer objects, such as
media and reach cards.
In the Bot Connector we map our attachment data structure to media
attachments and rich cards on each channel.
There are are several types of cards supported:
41.
42.
43.
44. Create your
own LU model
Train by providing
examples
Deploy to an HTTP
endpoint and
activate on any
device
Maintain model
with ease
45. Are there any vegetarian restaurants within 3 miles
from my house that is open now?
Entity: distanceEntity: type
Entity: reference Entity: condition
Intent: FIND_RESTAURANT
46. Go to luis.ai:
Sign in with your Microsoft account (MSA).
If you don’t have MSA, you will have an
option to create one.
Get started by creating a New App and
entering some basic information.
Next, you will be presented with the
Application Editor Workspace that will
allow you to create and train your own
language understanding model.
47. Intents:
Intents are actions that a user wants your
app to take or the information they
would like to obtain.
Example intents could include getting
weather, booking tickets, adding a
calendar entry or operating a light
fixture.
Add one or more of user intents that you
expect your app to handle by clicking +
next to Intents item in the in the left-
hand panel of the Editor Workspace.
48. Entities:
Entities are real world objects such as
persons, locations, organizations, products,
etc. that can be denoted with a proper name.
Entities can be abstract or have a physical
existence.
Entities can be generic (location, celebrity,
datetime) or more specific (Seattle, Satya
Nadella, June)
Add one or more entities that you expect
your app to recognize by clicking + next to
Entities item in the left-hand panel of the
Editor Workspace.
Several commonly used pre-built entities (e.g.
datetime, number) are also available to be
added to the app by clicking + next to Pre-
built Entities.
49. Seed the system with
more examples:
Enter more examples of queries that you
expect your users to make.
As you enter each one, you will need to:
• select the name of the correct intent from
the dropdown
• label your entities that appear in each
utterance by clicking on the entity and
choosing corresponding label from the list
• pre-built entities get automatically labeled
in grey
The more examples you provide, the more
accurate the predictions.
50. As you click Train at
left bottom corner of
the page, LUIS:
Generalizes from the examples you
provided.
Uses logistic regression classifiers to
recognize intents.
Uses conditional random field to
determine the entities.
51. Deploy the model to
an HTTP endpoint:
Click the Publish button in the upper left-
hand corner.
The URL that you see appear after a few
moments makes your model available as a
web service.
52. Deploy the model to
an HTTP endpoint:
Click the Publish button in the upper left-
hand corner.
The URL that you see appear after a few
moments makes your model available as a
web service.
53. Activate model from
your application on
any device:
Update the URL with the parameter
for the user query.
The response received from LUIS will
contain the list of detected intents
and entities together with the
confidence scores.
You can now use this information in
your app. For our example, we could
next call the weather service and
display the response in our app UI:
What’s the weather in
Berlin
The weather is sunny
with a temperature of
88°F. (data provided by Foreca
http://www.foreca.com)
54.
55.
56. 1 Extract questions and answers
QnA Maker extracts all possible pairs of questions and answers
from user provided content – FAQ URLs, documents and
editorial content.
2 Test, train and publish
Through QnA Maker’s easy-to-use GUI, you can edit, remove
or add pair before testing and training the knowledge base
and publishing your knowledge base as an API endpoint.
3 Integrates with other APIs and solutions
QnA Maker integrates with other APIs seamlessly and at scale. Use
QnA Maker with Cognitive Services such as Language Understanding
Intelligent Service and create something as elegantly simple as a chat
bot that answers FAQs, or as complex as an interactive virtual guide.
63. • fuzzy search keeps users from having to type exact matches;
• search scores allow us to determine the confidence of the results;
2. guiding a user through a conversation that facets and filters a dataset until
it finds what a user is looking for.
https://github.com/ryanvolum/AzureSearchBot
64.
65.
66. Faceted navigation is a filtering mechanism that
provides self-directed drilldown navigation in
search applications.
102. Telemetry is collected at each
tier: mobile applications, server
applications and browser1
Telemetry arrives in the Application
Insights service in the cloud where
it is processed & stored
Get a 360° view of the application
including availability, performance
and usage patterns3
2
Azure Application Insights
103.
104. require('dotenv-extended').load();
var appInsights = require("applicationinsights").setup().start();
...
bot.dialog('/alfa', [
function (session) {
appInsights.client.trackEvent("alfa");
session.send("Great, this is alfa");
session.endDialog();
}
]);
bot.dialog('/beta', [
function (session) {
appInsights.client.trackEvent("beta");
session.send("Great, this is beta");
session.endDialog();
}
]);
...
https://docs.microsoft.com/en-us/azure/application-insights/app-insights-nodejs
111. Hey, here’s what we’ve learned so far doing these things.
Come back tomorrow and we might have some new
learnings to share
112.
113. Browsing the same old information on a new platform is
not very useful: it’s missing personalization.
Chatbot is expected to be conversational: a simple search
bar can fits fine in a web page.
114.
115. What makes a bot great:
• It’s not how much AI it has
• It’s not how much natural language it offers
• It’s not whether it uses voice or not
It’s just whether it solves user’s needs in the quickest
and easier way comparted to other options
116.
117. A bot with a single dialog and 100 LUIS intents is a bad design:
118.
119. Events
Stages
Amenities
Music
Comedy
Film
Theater
• Guide the user
• Save time
• Help the user discover what your bot can do
What music would
you like?
(by the way, next
time you could just
type “I’m looking
for a song named
xyz” and I will know
what to do)
121. When given the choice of rich controls, text and voice, user
will choose:
1st UI controls
2nd Text
3rd Voice, only if options above aren’t possible
(i.e. driving a car)
122.
123.
124. When the conversation is the interface, experience design is all about
crafting the right words.
https://www.fastcodesign.com/3054934/the-next-phase-of-ux-designing-chatbot-personalities
The software must be doing a good job, because people know it’s a robot,
but still feel the need to say ‘thank you’.