Smart bots provide an amazing opportunity to generate lively, adaptive interfaces in the channels where your users are talking. In this presentation, we will kickstart a Node.js bot from Simple to Smart by integrating LUIS, creating meaningful conversations, and remembering user information. While it does take time to create custom dialogues, build and train LUIS, integrate with various channels, and create documentation, watching your intertwined dialog and code come to life results in a unique, naturally responsive bot.
5. LUIS: Cognitive Services
L U I S
Cognitive Services: LUIS abstracts this into a training model
Machine learning and deep learning algorithms abstracted
Natural Language Processing (NLP)
Using artificial intelligence to process natural language
Extract Entities (items in the utterance that are of value)
Extract Intents (meaning of the utterance or phrase)
@Saelia
10. Reduce labeling effort with interactive featuring
Seamless integration to Speech API
Deploy using just a few examples with active learning
Supports 5 languages (English, Chinese, Italian, French, Spanish)
Language Understanding Models
11. Bot Guidelines
1. Focus on real user needs
2. Make things discoverable
3. Teach people what they can do
4. Respect privacy
5. Make it easy to interact
6. Display output in an effective manner
7. Consider your bot’s personality
8. Take context into account
9. Encourage ongoing engagement
@Saelia
12. In review: session objectives and takeaways
Session objectives:
Understand how to design more engaging and usable chat bots
Incorporate bot user experience design principles into my customer projects
Design Bot conversations and personality so they deliver a great user
experience
Adhering to these principles will improve your
user experience and create greater engagement.
@Saelia
13. Calls to Action:
Steps: github.com/KSLHacks/BotScheduleDemo
Demo: Creating Bots in the Microsoft Bot Framework using Node.js MVA
Sample: GitHub Microsoft BotBuilder: Node examples basics-naturalLanguage/app.js
BotBuilder-Samples / Node / intelligence-LUIS
Slides: SlideShare.net/SarahSexton3
Docs: docs.botframework.com | luis.ai/home
Sarah Sexton
Technical Evangelist | Commercial Software Engineering
@Saelia
14. Build with Microsoft Tech
Explore developer tools, platforms, and API’s
docs.microsoft.com
@Saelia
Editor's Notes
Hello and welcome. My name is Sarah, Technical Evangelist with Microsoft.
Smart bots provide an amazing opportunity to generate lively, adaptive interfaces in the channels where your users are talking. In this presentation, we will kickstart a Node.js bot from Simple to Smart by integrating LUIS and creating meaningful conversations.
Connector to Platform Channels
One Bot : Many Channels and endpoints
Why restrict yourself to one platform?
Hit them all
Session data on the user – remember who they are
There are two ways that bots work under the hood. There are RULE-BASED BOTS., programed with conditions in an “if this then that” sort of way. OR, they use Artificial Intelligence, primarily Natural Language Processing, to function.
First, let’s go through how RULE-BASED BOTS work.
Rule based bots work by offering you multiple choice options. They do not understand language, and get stuck if you give an answer that is not part of their repository. These bots respond to commands that you are expecting the user to say – but only one explicit string of text. Then the bot goes in and parses the string that the user has given us to try and look for the additional information. If the bot doesn’t see it, maybe it could then start prompting the user.
Now let’s talk about ai-based bots.
AI based bots are smarter than rule based bots. They understand the context and intent of user.
The artificial intelligence bots in the market today actually use a subset of AI, called natural language processing (NLP).
They get involved in the conversation and pick up keywords and phrases from the user’s requirement. An ai-based bot would not get stuck if the user responded with ‘yeah’ instead of ‘yes,’ unlike a rule-based bot. Now, trying to do that type of processing is very very hard, and it might take you YEARS to reinvent the wheel and build your own natural language processing system. The good news is you DON’T have to do that!
At Microsoft we offer this tool called LUIS: the “Language Understanding Intelligence Service.”
Wouldn’t it be nice if I could talk to it in a natural way of speaking – the same way that I would I would talk to a friend?
Essentially what you do with LUIS is you train it with a bunch of example messages –messages that a user might actually say– and then you identify entities and intents of those messages. When I say entities, I mean the nouns in those messages, the things that you're dealing with and the things that you have to react to. And the intents are the verb of the whole message. What do you want the whole message to do? And now you can train this through a graphical user interfaces that we have online at luis.ai.
You can also do it programmatically through an API. It's got some built in intent handling in the Bot Framework. Within the Bot Framework you can basically write some logic that says, “hey, if I've mapped to this LUIS intent, then go ahead and execute this code.”
It's a lot of fun to use, so instead of just talking about it, I like to give a demo and actually dive into what LUIS looks like and what training a model actually looks like.
LUIS.ai: Training a LUIS model in the GUI web application.
One of the first thing’s you’ll notice is that you can enter an utterance here.
An utterance is an example message from the user.
You’ve also got Intents and Entities off to the side.
Create a new intent: a thing that you want the bot to go ahead and do.
Intent = verb.
That trains for model with one datapoint of data.
Entity = noun.
So now you’ve seen how we train our model. Now let’s take a look at how we handle it in code.
What I’ll show you now is a fully built little Node.js bot. I want to kickstart this bot from Simple to Smart by integrating LUIS.
If I compared the code side-by-side of this web chat bot WITH and WITHOUT luis, you would notice one of the first differences in adding LUIS to the code is grabbing the URL for my LUIS model. Naturally, I have to put that inside an environmental variable to keep it secret keep it safe, because it does contain a key that could be used by anyone who saw your code on GitHub if you uploaded it unprotected, so please take precautions to treat that LUIS URL like you would any other secure token of information.
On the next line, we’re going to create a recognizer. With LUIS what we do is send it a bit of information, let it figure out the intent (verb), let it figure out those entities (nouns), which will then allow it to recognize what the user is trying to do. This LUIS recognizer is built into the framework. Then I pass in the model URL.
On the next line, I want you to notice that when I go to build up a dialog object, rather than adding these into the bot individually, I’m going to create a FULL DIALOG OBJECT that fully encompasses all of the recognizers.