Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Chatbot development workshop with the Microsoft Bot Framework


Published on

Develop a chatbot from zero to hero using the Microsoft Bot Framework in Node.js.
Full day workshop with step by step exercises (code on GitHub), including unit test, continuous integration and continuous deployment.

Published in: Software
  • Hello! Get Your Professional Job-Winning Resume Here - Check our website!
    Are you sure you want to  Yes  No
    Your message goes here

Chatbot development workshop with the Microsoft Bot Framework

  1. 1. Build a chatbot, from Zero to Hero bot revolution Lab code:
  2. 2. Chat bots are services that people interact with through conversation and messaging.
  3. 3. Source: Conversational Interfaces, STCI Research (March 2016)
  4. 4. Hipmunk Bot & Reselling
  5. 5. Casey Neistat Bot & Affiliate Marketing
  6. 6. LMFAO’s FooBot & Cross promotion (Uber)
  7. 7. Westworld Bot (Aeden) & Viral Marketing
  8. 8. A new wave for user interfaces technology? Conversational Interfaces (teenies) Mobile Apps (noughties) Web Apps (90’s) Desktop GUI (80’s)
  9. 9. Your bot code Entity Extraction Speech Bot Clipboard w entities Natural Language Translation + Intelligent Services Bing Knowledge User Preferences Image Intelligence … Message input <> output State Management Bot Connector Service Conversation Canvas/Channels …… … Other services, APIs, Databases, Azure Machine Learning, Azure Search, etc… Bot Builder SDK Web Chat Direct Line… Email Facebook GroupMe Kik Skype Slack Telegram Twilio (SMS) Bot Builder SDK Your code goes here
  10. 10. creating-my-first-chatbot-using-microsoft-cognitive-services-and- python/
  11. 11. 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.
  12. 12. 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.
  13. 13. 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).
  14. 14. 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:
  15. 15. Create your own LU model Train by providing examples Deploy to an HTTP endpoint and activate on any device Maintain model with ease
  16. 16. 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
  17. 17. Go to 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.
  18. 18. 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.
  19. 19. 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.
  20. 20. 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.
  21. 21. 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.
  22. 22. 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.
  23. 23. 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.
  24. 24. 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
  25. 25. 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.
  26. 26.
  27. 27.
  28. 28. knowledgebaseId subscriptionKey
  29. 29. • 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.
  30. 30. Faceted navigation is a filtering mechanism that provides self-directed drilldown navigation in search applications.
  32. 32. LUIS, QnA Maker and Search are all powerful tools in building knowledge bots, but how do we choose which one to use? Can we use them together?
  33. 33. Language Speech Search Machine Learning Knowledge Vision Spell check Speech API Entity linking Recommendation API Bing autosuggest Computer vision Emotion Forecasting Text to speech Thumbnail generation Anomaly detection Custom recognition (CRIS) Bing image search Web language model Customer feedback analysis Academic knowledge OCR, tagging, captioning Sentiment scoring Bing news search Bing web search Text analytics Cognitive Services APIs
  34. 34.
  35. 35. Translator Text API
  36. 36. Text Analytics API Sentiment analysis Key phrase extraction Topics detection Language detection
  37. 37. Bot Connector Service Load Balancer Bot Connector Service Web App (PaaS)
  38. 38. Bot Connector Service test botwork
  41. 41. 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
  42. 42. 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(); } ]); ...
  43. 43.
  44. 44. Hey, here’s what we’ve learned so far doing these things. Come back tomorrow and we might have some new learnings to share
  45. 45. 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.
  46. 46. 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
  47. 47. A bot with a single dialog and 100 LUIS intents is a bad design:
  48. 48. 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)
  49. 49. Hipmunk (Skype) Alterra (Telegram)
  50. 50. 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)
  51. 51. When the conversation is the interface, experience design is all about crafting the right words. The software must be doing a good job, because people know it’s a robot, but still feel the need to say ‘thank you’.
  52. 52. Set the expectations. Is you bot like HAL 9000, R2-D2 or Roomba?
  53. 53. Your journey is just started, a bright future ahead.
  54. 54.