$30 off During Our Annual Pro Sale. View Details »

Boost your Bot's IQ

Boost your Bot's IQ

The talk is about how to add intelligence to the bot using Language Understanding Service (LUIS), Microsoft Bot Framework - NodeJS and Azure Services.

https://github.com/ksivamuthu/boost-bots-iq

- Introduction - Components of the chat-bot framework

- Bot Builder SDK for NodeJS - Closer look on the Microsoft's Bot Builder SDK for NodeJS by walking through Dialogs, Actions and State Data management

- Designing conversational flow - Managing conversation flow is an essential task in building bots. How a bot is able to perform core tasks elegantly and handle interruptions gracefully.

- Add Intelligence to Bot - How to train LUIS models and add intelligence to Bot

- Demo - Chatbot that demonstrates the conversational flow and LUIS Language processing.

Sivamuthu Kumar

June 14, 2018
Tweet

More Decks by Sivamuthu Kumar

Other Decks in Programming

Transcript

  1. Boost your Bot’s IQ
    Turn a dumb bot to the smarter bot...

    View Slide

  2. Hello World
    Conversation Flow
    Add Intelligence
    Deploy

    View Slide

  3. HELLO!
    I am Sivamuthu Kumar
    - Working as Architect in Computer Enterprises Inc
    - I am here to connect with you all.
    - You can reach me on @ksivamuthu

    View Slide

  4. HELLO!
    I am Raksha
    - A Bot Guru
    - Co-presenter of this session
    - Enlighten dumb bots and help them transformed into
    smarter bots

    View Slide

  5. Why Chatbot?
    ❏ People have a deep affection for intelligent
    conversation.
    ❏ Chatbot can help to bring brands to the user
    in user’s favorite messaging app / channel.
    @ksivamuthu

    View Slide

  6. What is Chatbot?
    ❏ A chat robot , a computer program that simulates
    human conversation, or chat, through artificial
    intelligence.
    ❏ It can be used to get things done or for fun.
    @ksivamuthu

    View Slide

  7. “Bots learn the same way
    people learn - through
    progression.”
    @ksivamuthu
    How does it work?

    View Slide

  8. User chats with bot Contextual Analysis by AI
    Real-time response,
    Personalized Interactions
    @ksivamuthu
    How does it work?

    View Slide

  9. @ksivamuthu
    Chatbot Architecture
    NLP - Natural Language Processing
    NLU - Natural Language Understanding
    NLG - Natural Language Generation

    View Slide

  10. Microsoft Bot Framework

    View Slide

  11. - Tools and services to
    build great bots that are
    conversing with the user
    - Open source SDK in
    Javascript (NodeJS), C#
    - Chat emulator
    Bot Builder
    - Connects your bots to
    text / sms, Skype, Slack,
    Facebook Messenger,
    O365, Direct Line in app
    etc.
    - Fast scalable message
    routing
    Developer Portal
    - Parse natural language
    using LUIS.
    - Cognitive Services
    enable your bot to see,
    hear, and interpret in
    more human ways
    Cognitive Services
    @ksivamuthu
    Microsoft Bot Framework

    View Slide

  12. @ksivamuthu

    View Slide

  13. Tools for Development
    ❏ NodeJS
    ❏ VSCode - VSCode can do anything.
    ❏ Azure Functions for Visual Studio Code - Create, debug, manage, and
    deploy Azure Functions directly from VS Code
    ❏ Azure Functions Pack - Package Azure Functions for optimization.
    @ksivamuthu

    View Slide

  14. Bot Framework Emulator

    View Slide

  15. Bot Framework Emulator
    ❏ Debug bots running on localhost
    ❏ Remote debugging (ngrok)
    ❏ Message Inspector
    ❏ Bot Transcripts
    ❏ Inspect Language Services
    ❏ Speech Recognition
    ❏ Manage Bot Resources
    @ksivamuthu

    View Slide

  16. Hello World Bot Demo

    View Slide

  17. Hello World
    Conversation Flow

    View Slide

  18. Designing Conversation

    View Slide

  19. Key Concepts
    ❏ Chat Interface
    ❏ Context or Memory of a Bot
    ❏ Loops, Splits and Recursion
    ❏ Integration with Legacy systems
    ❏ Handoff
    ❏ Character, Persona
    ❏ NLP Component
    @ksivamuthu

    View Slide

  20. Dialogs
    @ksivamuthu

    View Slide

  21. Conversation Flow - Waterfall
    ❏ Collect information from the user or guide the user through a sequence of
    tasks in waterfall dialog.
    ❏ The tasks are implemented as an array of functions where the results of the
    first function are passed as input into the next function, and so on.
    ❏ Handle interruptions and gracefully switch the context
    @ksivamuthu

    View Slide

  22. @ksivamuthu
    Conversation Flow - Waterfall

    View Slide

  23. Conversation Flow - Multiple Waterfalls

    View Slide

  24. Prompts
    @ksivamuthu
    Prompt type Description
    Prompts.text Asks the user to enter a string of text.
    Prompts.confirm Asks the user to confirm an action.
    Prompts.number Asks the user to enter a number.
    Prompts.time Asks the user for a time or date/time.
    Prompts.choice Asks the user to choose from a list of options.
    Prompts.attachment Asks the user to upload a picture or video.

    View Slide

  25. Cards
    @ksivamuthu

    View Slide

  26. Cards
    @ksivamuthu

    View Slide

  27. State Data
    @ksivamuthu
    The Bot Builder Framework enables your bot to store and retrieve state
    data that is associated with a user, a conversation, or a specific user
    within the context of a specific conversation.
    Development / Testing:
    - In Memory Data Storage
    Production:
    - Manage State data with Cosmos DB
    - Manage State data with Table Storage

    View Slide

  28. State Data
    @ksivamuthu
    Storage Containers Scoped to Description
    userData User Data that is saved for user on the specified channel
    privateConversation
    Data
    Conversation Data that is saved for user within the context of
    particular conversation on the specified channel
    conversationData Conversation Data that is saved in the context of particular
    conversation on the specified channel
    dialogData Dialog Data that is saved for the current dialog only. The
    property is cleared when the dialog is removed from
    stack.

    View Slide

  29. Restaurant Bot Demo

    View Slide

  30. Hello World
    Conversation Flow
    Add Intelligence

    View Slide

  31. Language Understanding (LUIS)

    View Slide

  32. LUIS - Overview
    ● Language Understanding Intelligent Service (LUIS) is NLP as a service
    ● NLP is a mechanism to extract the intention (Intent) and relevant information
    (Entity) from user input.
    ● Using machine learning, LUIS allows developers to build applications which
    receives user input (Utterances) in a natural language and parses to find what
    action (Intent) needs to be performed with supplied parameters (Entity).
    @ksivamuthu

    View Slide

  33. @ksivamuthu

    View Slide

  34. Anatomy of an intent
    Are there any Chinese restaurants within 3 miles from my
    house that is open now ?
    Entities Values
    Cuisine Chinese
    Distance 3 miles
    Reference My house
    Condition Open now
    @ksivamuthu
    Intent - Restaurants.Search

    View Slide

  35. LUIS Restaurant Bot Demo

    View Slide

  36. Bot’s success factors

    View Slide

  37. Make UX a Top Priority
    ❏ Does the bot easily solve the user’s problem with the minimum number of steps?
    ❏ Does the bot solve the user’s problem better/easier/faster than any of the
    alternative experiences?
    ❏ Does the bot run on the devices and platforms the user cares about?
    ❏ Is the bot discoverable? Do the users naturally know what to do when using it?
    @ksivamuthu

    View Slide

  38. Hello World
    Conversation Flow
    Add Intelligence
    Deploy

    View Slide

  39. Deploy your bot to Azure

    View Slide

  40. Application Insights

    View Slide

  41. Application Insights
    ❏ Add the instrumentation Key to
    the Bot
    ❏ Instrument the code using App
    Insights
    ❏ Track dialog flows and custom
    events
    ❏ Application Insights -
    Dashboard
    @ksivamuthu

    View Slide

  42. Hello World
    Conversation Flow
    Add Intelligence
    Deploy

    View Slide

  43. More Cognitive Services...

    View Slide

  44. Knowledge
    Search
    Language
    Cognitive Services
    Vision Speech
    Computer Vision
    Face
    Emotion
    Content Moderator
    Video
    Video Indexer
    Cognitive Vision
    Text Analytics
    Bing Spell Check
    LUIS
    Translator Text
    Content Moderator
    Speech to Text
    Text to Speech
    Speaker Recognition
    Speech Translation
    Bing Web Search
    Bing Custom Search
    Bing Video Search
    Bing Image Search
    Bing Visual Search
    Bing Entity Search
    Bing News Search
    Bing Autosuggest
    QnA maker
    Recommendations
    @ksivamuthu

    View Slide

  45. Links
    ★ Microsoft Bot Framework Docs
    https://docs.microsoft.com/en-us/azure/bot-service
    ★ Bot Builder SDK
    https://github.com/Microsoft/BotBuilder
    ★ Boost your Bot’s IQ - Demo
    https://github.com/ksivamuthu/boost-bots-iq
    ★ Boost your Bot’s IQ - Slides
    http://siva.shortcm.li/oaVaJo
    @ksivamuthu

    View Slide

  46. Thank you !!!

    View Slide