+ All Categories
Home > Documents > Webinar Series: Azure Advanced Technologies In …...Azure Bot Service provides tools to build,...

Webinar Series: Azure Advanced Technologies In …...Azure Bot Service provides tools to build,...

Date post: 25-May-2020
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
26
November 2019 Webinar Series: Azure Advanced Technologies In Practice Deliver Virtual Applications on Cloud
Transcript
  • November 2019

    Webinar Series:Azure Advanced Technologies In Practice

    Deliver Virtual Applications on Cloud

  • 2

    Presenter

    Petros PetrouCloud Technical Leader

    Get in touch:[email protected]

  • 3

    The Webinar Series

    Series of 10 Webinars started on 24 July 2019 and ending in November 2019Based on the new Logicom’ s Azure Advanced Solutions CatalogueOne, 1-hour, Webinar for each Advanced Solution in the CatalogueSimple and consistent webinar structure:– Business Need, Proposed Solution, Solution Abstract, Solution Details, Solution Demo (where possible), Q & A

    Easy registration for each webinar in the series at https://cloud.logicom.net/events/Watch on demand the webinars recording athttps://cloud.logicom.net/webinars/

    Share reference solutions for business problems with combinations of Azure services

    What is Webinar Series About?

    Webinar Series Details

    https://cloud.logicom.net/events/https://cloud.logicom.net/webinars/

  • 4

    Azure Solutions Catalogue – Advanced Solutions

    • Azure Stack Hybrid Cloud Platform• Build Serverless Applications on Cloud• HPC Video Rendering in Cloud• Securing & Monitoring Hybrid Cloud Environments• Development & Testing in Cloud• Build IoT Solutions on Cloud• Big Data with Analytics on Cloud• Build Intelligent Chatbots on Cloud• Deliver Virtual Applications on Cloud• Deliver Virtual Desktops on Cloud

  • 5

    Agenda

    Real life Business RequirementProposed Solution AbstractProposed Solution Detailso Solution Characteristics & Business Benefitso Solution Architectural Componentso Deployment Guidanceo Solution Demoo Solution Use caseso Indicative Configuration

    Q n A

  • 6

    Real Life Business Requirement

    Contoso is a big dining restaurant chain with many restaurants all over the country. The existing business model is entirely people-centric, experiencing a bottleneck in scaling the business operations especially during peak hours and holidays with high call volume which could not be addressed.

    Contoso is looking for an AI-based chatbot solution which would assist clients with their reservations as well as answer any informational questions for the restaurant chain itself.

    Business Need

    Requirements

    How can we help?

    Be able to assist the clients with Checking Availability Make a Reservation Modify a Reservation Cancel Reservation Confirm a Reservation Answer informational questions

    Quick Implementation and fast time to market Easy process to train and update the chatbot Integrate the chatbot with backend reservation engine Support channels like Web and Facebook Messenger Add French language support in a future release Pay only for resources consumed in a PAYG model

  • Build Intelligent Chatbots on Cloud

    Solution AbstractWhat is a Bot?What is Azure Bot Service?Why use Azure Bot Service?

  • 8

    What is it?

    Azure Bot Service provides tools to build, test, deploy, and manage intelligent bots all in one place. Through the modular and extensible framework provided by the SDK, developers can leverage templates to create bots that provide speech, understand natural language, handle questions and answers, and more.

    What is Azure Bot Service?

    Why use Azure Bot Service?

    A managed service purpose-built for bot development Easily add natural language and speech to your bot Easily build conversational experiences Start simply and grow in sophistication

    Deploy your bot to popular channels, wherever your customers interact

    Use open-source SDK and tools to build, test, and publish your bot to Azure

    A bot is an app that users interact with in a conversational way using text, interactive cards, and speech. A bot interactioncan be quick a question and answer, or it can be a sophisticated conversation that provides access to services in an intelligent manner.

    What is a Bot?

  • Build Intelligent Chatbots on Cloud

    Azure Solution Details Azure Resources Solution Characteristics and Business Benefits Solution Architectural Components Key points of Consideration Implementation steps Solution Demo Indicative Configuration Solution Use cases

  • 10

    What is Azure Web Apps?

    Why use Azure Web Apps?

    Azure Web Apps

    Azure Web Apps is a service for hosting web applications, REST APIs, and mobile back ends. Develop in your favorite language, be it .NET, .NET Core, Java, Ruby, Node.js, PHP, or Python. Run and scale apps easily on Windows or Linux VMs.

    Web Apps not only adds the power of Microsoft Azure to applications, such as security, load balancing, autoscaling, and automated management. Developers can also take advantage of its DevOps capabilities, such as continuous deployment from Azure DevOps, GitHub, Docker Hub, and other sources, package management, staging environments, custom domain, and SSL certificates.

    Multiple languages and frameworks

    Global scale with high availability

    Connections to SaaS platforms & on-premises data

    Security and compliance

    Application templates

    Visual Studio integration

    Serverless code

    New version deploy with no downtime

  • 11

    Azure Cognitive Services

    What is Azure Cognitive Services?

    Why use Azure Cognitive Services?

    Azure Cognitive Services are APIs, SDKs, and services available to help developers build intelligent applications without having direct AI or data science skills or knowledge.

    The goal of Azure Cognitive Services is to help developers create applications that can see, hear, speak, understand, and even begin to reason. The catalogue of services within Azure Cognitive Services can be categorized into five main pillars -Vision, Speech, Language, Search, and Knowledge.

    Analyze images using Computer Vision

    Recognize speech using Speech Service

    Detect language, analyze sentiment using Text Analytics

    Get relevant web queries using Bing Web Search

    Get relevant image queries using Bing Image Search

    Get intent using LUIS

    Enhance security with a face

    Express dramatic moments instantly

    Enable voice interactions with speech customization

    Engage customers through chat

  • 12

    QnA Maker Service

    What is QnA Maker?Microsoft QnA Maker is a free, easy-to-use, web-based service and REST-API that trains AI to respond to user's questions in a more natural, conversational way. Compatible across development platforms, hosting services, and channels, QnA Maker is the only question and answer service with a graphical user interface-meaning you don’t need to be a developer to train, manage, and use it for a wide range of solutions.

    With optimized machine learning logic and the ability to integrate industry-leading language processing with ease, QnA Maker distils masses of information into distinct, helpful answers.

    Why use QnA Maker?

    Quickly extract questions & answers from existing content

    Easily train and improve question-and-answer bot service

    Scale your service according to business and compliance needs

    Expand your options by integrating with other APIs

  • 13

    LUIS

    What is LUIS?Language Understanding (LUIS) is a cloud-based API service that applies custom machine-learning intelligence to a user's conversational, natural language text to predict overall meaning, and pull out relevant, detailed information.

    A client application for LUIS is any conversational application that communicates with a user in natural language to complete a task. Examples of client applications include social media apps, chat bots, and speech-enabled desktop applications.

    Why use LUIS?o Add natural language to Bots o Quickly build custom language solutions

    o Continues Learning & Improvement o Enterprise-ready & Available Worldwide

  • 14

    What is Azure Application Insights?

    Why use Azure Application Insights?

    Azure Application Insights

    Application Insights is an extensible Application Performance Management (APM) service for web developers building and managing apps on multiple platforms. It includes powerful analytics tools to help diagnose issues and to understand what users actually do with your application.

    It's designed to help in continuously improving performance and usability. It works for apps on a wide variety of platforms including .NET, Node.js and J2EE, hosted on-premises or in the cloud.

    Application Insights is aimed at the development team, to help in understanding how an app is performing and how it's being used. It can monitor:

    Request rates, response times, and failure rates Dependency rates, response times, and failure rates Exceptions Page views and load performance AJAX calls

    User and session counts Performance counters Host diagnostics Diagnostic trace logs Custom events and metrics

  • 15

    Solution Characteristics & Benefits

    Related Azure Resources

    Deploy a QnA Chatbot with Language Understanding

    Cost less to develop than applications Integrated development experience No need to download a bot client Chabot can be created with a personality Connect to multiple communication channels Recognize both text and voice Easily train and test bots from GUI Monitor bot healthiness & performance

    Solution Characteristics

    Business Benefits Save money on human labor Pay only for resources used 24*7 availability with consistent performance Handle multiple requests simultaneously Respond to requests from different channels Improve customer experience & loyalty Offer localized language experiences

    Optional Azure Resources

    App Service PlanMicrosoft

    App ServiceMicrosoft

    Azure Application InsightsMicrosoft

    Visual StudioMicrosoft

    QnA Maker ServiceMicrosoft

    Search ServiceMicrosoft

    Web App BotMicrosoft

    App Service PlanMicrosoft

    App ServiceMicrosoft

    LUIS ServiceMicrosoft

    Bot Channels

    QnA Maker

    WebAppBot

    . . .Other Cognitive ServicesMicrosoft

  • 16

    Solution Architectural Diagram

  • 17

    Key Points of Consideration

    • Choose your favourite development environment to create your bot in C#, JavaScript, or Typescript. (Java and Python arecoming too!) (Details)

    • Azure Bot Service channels are divided into Standard and Premium. Standard channels include Microsoft first-partyservices (such as Skype, Cortana & Microsoft Teams) and services with publicly available Bot API’s (such as Facebook &Slack). Premium channels allow bots to reliably communicate with users within your own application or on your website

    • Azure Bot Service, QnA Maker, LUIS and Azure Search offer a Free tier plan for testing and development.

    • QnA Maker is currently available only for these regions

    • QnA Maker supports question/answer extraction in any language page, but the effectiveness of the extraction is muchhigher for these languages

    • There are three LUIS websites, based on region. You must author and publish in the same region (Details)

    • Continuously Train and Publish both QnA Service and LUIS to increase Bot effectiveness and accuracy.

    • You can equip your Bot with a specific type of personality to enhance your Bot’s conversational capabilities (Details)

    • In Bot logic you can use more Azure Services like Databases, Storage, Logic Apps, Function Apps. Etc. and also call externalsystem APIs like CRM, ERP, etc. to make the bot more functional solve business problems.

    • GitHub Templates can be useful to begin building Bots

    https://docs.microsoft.com/en-us/azure/bot-service/bot-service-overview-introduction?view=azure-bot-service-4.0&viewFallbackFrom=azure-bot-service-3.0/https://azure.microsoft.com/en-us/pricing/details/cognitive-services/qna-maker/https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-regionshttps://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/concepts/best-practiceshttps://github.com/Microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/11.qnamaker

  • 18

    Deployment Guide

    Deployment Guide

    1. Review Microsoft Bot Framework with Bot Builder V4 SDK2. Plan and design your Bot deployment3. Download and install Visual Studio4. Download and install Bot Builder V4 SDK or later for Visual Studio5. Download and install Bot Framework Emulator6. Create a QnA Maker Account7. Create, Publish, Train and Test your Knowledge Base8. Create a LUIS Account9. Build your LUIS Model, Train and Publish10. Create a bot using Bot Builder SDK in Visual Studio and name it “DemoBot”11. Install all Visual Studio missing packages using NuGet12. Update BotConfiguration.bot file with QnA and LUIS Account details13. Create BotServices.cs class14. Update Startup.cs class15. Configure Saving User and Conversation Data and update TopicState.cs16. Update EchoWithCounterBot.cs class17. Test Bot functionality using Bot Framework Emulator18. Create Azure WebApp Bot and Deploy Bot to Azure WebApp Bot19. Configure Connection Channels20. Evaluate Bot performance and tune

    *Deployment Guide refers to a Restaurant Customer Service Bot

    https://blog.botframework.com/2018/05/07/build-a-microsoft-bot-framework-bot-with-the-bot-builder-sdk-v4/https://docs.microsoft.com/en-us/azure/bot-service/bot-service-design-principles?view=azure-bot-service-4.0https://visualstudio.microsoft.com/downloads/https://marketplace.visualstudio.com/items?itemName=BotBuilder.botbuilderv4https://github.com/Microsoft/BotFramework-Emulator/releaseshttps://www.qnamaker.ai/https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/quickstarts/create-publish-knowledge-basehttps://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-how-to-start-new-apphttps://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-how-to-add-intentshttps://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-how-to-trainhttps://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-how-to-publish-apphttps://docs.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-sdk-quickstart?view=azure-bot-service-4.0https://docs.microsoft.com/en-us/nuget/tools/package-manager-uihttps://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-qna?view=azure-bot-service-4.0&tabs=cshttps://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-v4-luis?view=azure-bot-service-4.0&tabs=cshttps://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-v4-state?view=azure-bot-service-4.0&tabs=csharphttps://docs.microsoft.com/en-us/azure/bot-service/bot-service-debug-emulator?view=azure-bot-service-4.0https://docs.microsoft.com/en-us/azure/bot-service/bot-service-quickstart?view=azure-bot-service-4.0https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-deploy-azure?view=azure-bot-service-4.0https://docs.microsoft.com/en-us/azure/bot-service/bot-service-manage-channels?view=azure-bot-service-4.0

    Install Visual Studio Packages using NuGet

    Microsoft.Bot.Builder.AI.QnA

    Microsoft.Bot.Builder.AI.Luis

    Microsoft.Bot.Builder.Dialogs

    Microsoft.Bot.Builder.PersonalityChat

    Update BotConfiguration.bot file with QnA and LUIS Account details

    1. Select your Project

    1. Right-Click and select Add-> New Item

    1. Select JSON File and name it QnABot.bot

    1. Paste in QnQBot.bot file the following code with QnA Account details:

    {

    "name": "QnABot",

    "services": [

    {

    "type": "endpoint",

    "name": "development",

    "endpoint": "http://localhost:3978/api/messages",

    "appId": "",

    "appPassword": "",

    "id": "1"

    },

    {

    "type": "qna",

    "name": "QnABot",

    "KbId": "",

    "Hostname": "https://.azurewebsites.net/qnamaker",

    "EndpointKey": "Your_Endpoint_Key"

    }

    ],

    "padlock": "",

    "version": "2.0"

    }

    1. Replace “KbId”, “Hostname” and “EndpointKey” values with your QnA Maker details

    1. Paste in QnQBot.bot file the following code with QnA Account details right after QnA Service bracket “}” and before closing bracket “]” using a comma “,”:

    {

    "type": "luis",

    "name": "LuisBot",

    "AppId": "",

    "SubscriptionKey": "",

    "AuthoringKey": "",

    "GetEndpoint": "",

    "Region": "Your_Region"

    1. Replace “AppId”, “SubscriptionKey”, “AuthonirgKey”, “GetEndpoint” and “Region” values with your LUIS application details

    Update/create QnABot.bot file with QnA Account details

    1. Select your Project

    1. Right-Click and select Add-> Class

    1. Select Class and name it BotServices.cs

    1. Paste in the following code:

    Update Startup.cs class

    1. Under services.AddBot:

    Comment out the following Service variable line by adding “//” in the beginning:

    var service = botConfig.Services.Where(s => s.Type == "endpoint" && s.Name == environment).FirstOrDefault();

    And replace it with:

    var service = botConfig.Services.FirstOrDefault(s => s.Type == "endpoint" && s.Name == environment);

    1. Move the below three variables outside services.AddBot right below public void ConfigureServices(IServiceCollection services):

    var secretKey = Configuration.GetSection("botFileSecret")?.Value;

    var botFilePath = Configuration.GetSection("botFilePath")?.Value;

    var botConfig = BotConfiguration.Load(botFilePath ?? @".\BotConfiguration.bot", secretKey);

    1. Add the following variable right after the previous variables:

    var connectedServices = InitBotServices(botConfig);

    1. Add the following singletons right after the connectedServices variable:

    services.AddSingleton(sp => connectedServices);

    services.AddSingleton(sp => botConfig);

    1. Add the following InitBotServices method at the end of the class file:

    private static BotServices InitBotServices(BotConfiguration config)

    {

    var qnaServices = new Dictionary();

    var luisServices = new Dictionary();

    foreach (var service in config.Services)

    {

    switch (service.Type)

    {

    case ServiceTypes.QnA:

    {

    // Create a QnA Maker that is initialized and suitable for passing

    // into the IBot-derived class (QnABot).

    var qna = (QnAMakerService)service;

    if (qna == null)

    {

    throw new InvalidOperationException("The QnA service is not configured correctly in your '.bot' file.");

    }

    if (string.IsNullOrWhiteSpace(qna.KbId))

    {

    throw new InvalidOperationException("The QnA KnowledgeBaseId ('kbId') is required to run this sample. Please update your '.bot' file.");

    }

    if (string.IsNullOrWhiteSpace(qna.EndpointKey))

    {

    throw new InvalidOperationException("The QnA EndpointKey ('endpointKey') is required to run this sample. Please update your '.bot' file.");

    }

    if (string.IsNullOrWhiteSpace(qna.Hostname))

    {

    throw new InvalidOperationException("The QnA Host ('hostname') is required to run this sample. Please update your '.bot' file.");

    }

    var qnaEndpoint = new QnAMakerEndpoint()

    {

    KnowledgeBaseId = qna.KbId,

    EndpointKey = qna.EndpointKey,

    Host = qna.Hostname,

    };

    var qnaMaker = new QnAMaker(qnaEndpoint);

    qnaServices.Add(qna.Name, qnaMaker);

    break;

    }

    case ServiceTypes.Luis:

    {

    var luis = (LuisService)service;

    if (luis == null)

    {

    throw new InvalidOperationException("The LUIS service is not configured correctly in your '.bot' file.");

    }

    var app = new LuisApplication(luis.AppId, luis.AuthoringKey, luis.GetEndpoint());

    var recognizer = new LuisRecognizer(app);

    luisServices.Add(luis.Name, recognizer);

    break;

    }

    }

    }

    var connectedServices = new BotServices(qnaServices, luisServices);

    return connectedServices;

    }

    Update TopicState.cs file

    1. Add First Message Variable as it is showing below without changing the rest of the code:

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Threading.Tasks;

    namespace DemoBot

    {

    public class TopicState

    {

    public string Prompt { get; set; } = "Welcome";

    public bool FirstMessage { get; set; } = false; //Add First Message Boolean Variable

    }

    }

    Update EchoWithCounterBot.cs class

    1. Add the below four variables in the EchoWithCounterBot class:

    private readonly BotServices _services;

    public static readonly string QnAMakerKey = "QnABot";

    public static readonly string LuisKey = "LuisBot";

    private const string WelcomeText = @"This bot will introduce you to QnA Maker.

    Ask a question to get started.";

    1. Change the EchoWithCounterBot condtructor arguments:

    From

    public EchoWithCounterBot(EchoBotAccessors accessors, ILoggerFactory loggerFactory)

    To:

    public EchoWithCounterBot(BotServices services, EchoBotAccessors accessors, ILoggerFactory loggerFactory)

    1. Add the following QnA and LUIS Services in the EchoWithCounterBot constructor:

    _services = services ?? throw new System.ArgumentNullException(nameof(services));

    if (!_services.QnAServices.ContainsKey(QnAMakerKey))

    {

    throw new System.ArgumentException($"Invalid configuration. Please check your '.bot' file for a QnA service named '{QnAMakerKey}'.");

    }

    if (!_services.LuisServices.ContainsKey(LuisKey))

    {

    throw new System.ArgumentException($"Invalid configuration. Please check your '.bot' file for a LUIS service named '{LuisKey}'.");

    }

    1. Add the following method at the end of the file:

    private static async Task SendWelcomeMessageAsync(ITurnContext turnContext, CancellationToken cancellationToken)

    {

    foreach (var member in turnContext.Activity.MembersAdded)

    {

    if (member.Id != turnContext.Activity.Recipient.Id)

    {

    var reply = turnContext.Activity.CreateReply($"Welcome to Logicom Restaurant Online Help. {WelcomeText}");

    reply.SuggestedActions = new SuggestedActions()

    {

    Actions = new List()

    {

    new CardAction() { Title = "Help", Type = ActionTypes.ImBack, Value = "Help" },

    new CardAction() { Title = "Reservations", Type = ActionTypes.ImBack, Value = "Reservations" }

    },

    };

    await turnContext.SendActivityAsync(

    reply,

    cancellationToken: cancellationToken);

    }

    }

    }

    1. Replace all contents of “OnTurnAsync” method with the new bot logic that includes both LUIS and QnA services with the following:

    if (turnContext.Activity.Type == ActivityTypes.Message)

    {

    // ADDED BY PETROS

    // Get the conversation state from the turn context.

    var convo = await _accessors.TopicState.GetAsync(turnContext, () => new TopicState());

    // Get the user state from the turn context.

    var user = await _accessors.UserProfile.GetAsync(turnContext, () => new UserProfile());

    // END

    if (turnContext.Activity.Text == "Help" || turnContext.Activity.Text == "Reset" ||

    turnContext.Activity.Text == "Reservations")

    {

    convo.Prompt = turnContext.Activity.Text;

    convo.FirstMessage = true;

    // Set the property using the accessor

    await _accessors.TopicState.SetAsync(turnContext, convo);

    // Save the new prompt into the conversation state.

    await _accessors.ConversationState.SaveChangesAsync(turnContext);

    }

    if (convo.Prompt == "Reservations")

    {

    if (!convo.FirstMessage)

    {

    // LUIS Model

    var recognizerResult = await _services.LuisServices[LuisKey].RecognizeAsync(turnContext, cancellationToken);

    var topIntent = recognizerResult?.GetTopScoringIntent();

    if (topIntent != null && topIntent.HasValue && topIntent.Value.intent != "None")

    {

    if (topIntent.Value.intent == "NewReservation")

    {

    // YOUR BOT LOGIC FOR NEW RESERVATIONS GOES HERE

    await turnContext.SendActivityAsync($"==>LUIS Top Scoring Intent: {topIntent.Value.intent}, Score: {topIntent.Value.score}\n");

    }

    else if (topIntent.Value.intent == "CancelReservation")

    {

    // YOUR BOT LOGIC FOR CANCELING A RESERVATION GOES HERE

    await turnContext.SendActivityAsync($"==>LUIS Top Scoring Intent: {topIntent.Value.intent}, Score: {topIntent.Value.score}\n");

    }

    else if (topIntent.Value.intent == "ChangeReservation")

    {

    // YOUR BOT LOGIC FOR CHANGING A RESERVATION GOES HERE

    await turnContext.SendActivityAsync($"==>LUIS Top Scoring Intent: {topIntent.Value.intent}, Score: {topIntent.Value.score}\n");

    }

    else if (topIntent.Value.intent == "ReservationInformation")

    {

    // YOUR BOT LOGIC FOR CHANGING A RESERVATION GOES HERE

    await turnContext.SendActivityAsync($"==>LUIS Top Scoring Intent: {topIntent.Value.intent}, Score: {topIntent.Value.score}\n");

    }

    else

    {

    // YOUR LOGIC FOR HANDLING UNKNOWN INTENTS

    await turnContext.SendActivityAsync($"==>LUIS Top Scoring Intent: {topIntent.Value.intent}, Score: {topIntent.Value.score}\n");

    }

    }

    else

    {

    var msg = @"No LUIS intents were found.

    This sample is about identifying two user intents:

    'Calendar.Add'

    'Calendar.Find'

    Try typing 'Add Event' or 'Show me tomorrow'.";

    await turnContext.SendActivityAsync(msg);

    }

    }

    else

    {

    convo.FirstMessage = false;

    // Set the property using the accessor

    await _accessors.TopicState.SetAsync(turnContext, convo);

    // Save the new prompt into the conversation state.

    await _accessors.ConversationState.SaveChangesAsync(turnContext);

    var msg = $"Type 'Reset' at any point to return to the menu options. \n\nYou have selected the Reservation department. How can I help?";

    await turnContext.SendActivityAsync(msg);

    }

    }

    else if (convo.Prompt == "Help")

    {

    if (!convo.FirstMessage)

    {

    // QnA Model

    var response = await _services.QnAServices[QnAMakerKey].GetAnswersAsync(turnContext);

    if (response != null && response.Length > 0)

    {

    await turnContext.SendActivityAsync(response[0].Answer, cancellationToken: cancellationToken);

    }

    else

    {

    var msg = @"No QnA Maker answers were found. This example uses a QnA Maker Knowledge Base that focuses on smart light bulbs.

    To see QnA Maker in action, ask the bot questions like 'Why won't it turn on?' or 'I need help'.";

    await turnContext.SendActivityAsync(msg, cancellationToken: cancellationToken);

    }

    }

    else

    {

    convo.FirstMessage = false;

    // Set the property using the accessor

    await _accessors.TopicState.SetAsync(turnContext, convo);

    // Save the new prompt into the conversation state.

    await _accessors.ConversationState.SaveChangesAsync(turnContext);

    var msg = $"Type 'Reset' at any point to return to the menu options. \n\nWhat would you like to know about our Restaurant?";

    await turnContext.SendActivityAsync(msg);

    }

    }

    else if (convo.Prompt == "Welcome" || convo.Prompt == "Reset")

    {

    // Create a welcome message with the options menu - PETROS

    var reply = turnContext.Activity.CreateReply("Hello! How can I help you? Please choose one of the below:");

    reply.SuggestedActions = new SuggestedActions()

    {

    Actions = new List()

    {

    new CardAction() { Title = "Help", Type = ActionTypes.ImBack, Value = "Help" },

    new CardAction() { Title = "Reservations", Type = ActionTypes.ImBack, Value = "Reservations" }

    },

    };

    await turnContext.SendActivityAsync(

    reply,

    cancellationToken: cancellationToken);

    }

    }

    else if (turnContext.Activity.Type == ActivityTypes.ConversationUpdate)

    {

    if (turnContext.Activity.MembersAdded != null)

    {

    // Send a welcome message to the user and tell them what actions they may perform to use this bot

    await SendWelcomeMessageAsync(turnContext, cancellationToken);

    }

    }

    else

    {

    await turnContext.SendActivityAsync($"{turnContext.Activity.Type} event detected", cancellationToken: cancellationToken);

    }

    }

  • Demo

    Solution Abstract Create a QnA Service Populate Knowledge Base to QnA Service Create an Azure Web App Bot Integrate with Azure Web App Bot Test it out

  • 20

    Indicative Solution Use Cases

    HR Assistant Keeping the pulse of your employees: Integrate Chatbots into your collaboration environment like Slack to monitor their

    satisfaction and productivity.Answering common HR related questions: It is time consuming and boring for employees but an ideal job for Chatbots

    Sales assistant: Integrated to CRM systems, it can notify sales personnel when they are assigned opportunities, simplifying lead creation and updates

    Customer outreach: Send automated emails and Chabot's can respond immediately to leads

    Recommending new offers: Recommending the right products to the customer based on feedbackUnderstanding your customers: Asking the right questions at the right times on your application or website

    Answering frequently asked questions: Using a knowledge base of question and answer pairs Resolving customer queries: Answering questions is helpful but a Chabot is not that useful if it can not complete transactions

    Customer Service Agent

    Marketing Officer

    Sales Officer

  • 21

    Indicative Configuration

    Microsoft Azure EstimateRestaurant Customer Service Bot (Informationm + Reservations)Service type Requirements Region DescriptionApp Service Web App for hostig QnA and Bot Service

    S1 is the minimum supported TierWest Europe Standard Tier; 1 S1 (1 Core(s), 1.75 GB RAM, 50 GB Storage) x

    730 Hours; Windows OSCognitive Services QnA Maker

    99.9% SLAUnlimited number of documents

    West Europe Standard tier; Unlimited number of managed documents.

    Azure Bot Service Service that will host the Bot Code99.9% SLAAbility to ScalePremium Channel - Website100 Tables x 20 messages/customer = 2000 Messages2k - 8k Messages in Information questions

    S1 tier, 10000 messages in Premium Channels

    Azure Search QnA Search function99.9% SLAAbility to ScaleAvg of 300 h/month

    West Europe Basic, 1 Unit(s), 300 Hour(s)

    Cognitive Services LUIS - Lunguage Understanding99.9% SLAUsed to recognize user Intent (Reserve, Cancel, etc.)100 Tables x 20 messages/table = 2000 messages

    West Europe Language Understanding (LUIS) API: Text Requests tier, 2,000 Transactions.

    Storage Bot Storage West Europe Block Blob Storage, General Purpose V1, LRS Redundancy, 10 GB Capacity, 1000 Storage transactions

    Monthly TotalAnnual Total

    DisclaimerAll prices shown are in US Dollar ($). This is a summary estimate, not a quote. For up to date pricing information please visit https://azure.microsoft.com/pricing/calculator/This estimate was created at 11/1/2018 6:44:46 AM UTC.

  • Questions?

  • LogicomGet in Touch

  • 24

    Logicom – Get in Touch with Cloud Sales Teams

  • 25

    Next Webinar

    • Azure Stack Hybrid Cloud Platform• Build Serverless Applications on Cloud• HPC Video Rendering in Cloud• Securing & Monitoring Hybrid Cloud Environments• Development & Testing in Cloud• Build IoT Solutions on Cloud• Big Data with Analytics on Cloud• Build Intelligent Chatbots on Cloud• Deliver Virtual Applications on Cloud• Deliver Virtual Desktops on Cloud

  • Logicom Cisco Distribution Playbook26| Introduction | Strategy | Architectures | Services | Marketing | Operations | Meet the Team

    26

    https://www.facebook.com/LogicomDistributionhttps://twitter.com/LogicomDistihttps://www.linkedin.com/company/logicomhttp://www.instagram.com/logicomdisti

    Slide Number 1PresenterThe Webinar SeriesSlide Number 4AgendaReal Life Business RequirementSlide Number 7What is it?Slide Number 9Azure Web AppsAzure Cognitive ServicesQnA Maker ServiceLUISAzure Application InsightsSolution Characteristics & BenefitsSolution Architectural DiagramKey Points of ConsiderationDeployment GuideSlide Number 19Indicative Solution Use CasesIndicative ConfigurationSlide Number 22Logicom�Get in TouchSlide Number 24Slide Number 25Slide Number 26

    /ColorImageDict > /JPEG2000ColorACSImageDict > /JPEG2000ColorImageDict > /AntiAliasGrayImages false /CropGrayImages true /GrayImageMinResolution 300 /GrayImageMinResolutionPolicy /OK /DownsampleGrayImages true /GrayImageDownsampleType /Bicubic /GrayImageResolution 300 /GrayImageDepth -1 /GrayImageMinDownsampleDepth 2 /GrayImageDownsampleThreshold 1.50000 /EncodeGrayImages true /GrayImageFilter /DCTEncode /AutoFilterGrayImages true /GrayImageAutoFilterStrategy /JPEG /GrayACSImageDict > /GrayImageDict > /JPEG2000GrayACSImageDict > /JPEG2000GrayImageDict > /AntiAliasMonoImages false /CropMonoImages true /MonoImageMinResolution 1200 /MonoImageMinResolutionPolicy /OK /DownsampleMonoImages true /MonoImageDownsampleType /Bicubic /MonoImageResolution 1200 /MonoImageDepth -1 /MonoImageDownsampleThreshold 1.50000 /EncodeMonoImages true /MonoImageFilter /CCITTFaxEncode /MonoImageDict > /AllowPSXObjects false /CheckCompliance [ /None ] /PDFX1aCheck false /PDFX3Check false /PDFXCompliantPDFOnly false /PDFXNoTrimBoxError true /PDFXTrimBoxToMediaBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXSetBleedBoxToMediaBox true /PDFXBleedBoxToTrimBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXOutputIntentProfile () /PDFXOutputConditionIdentifier () /PDFXOutputCondition () /PDFXRegistryName () /PDFXTrapped /False

    /CreateJDFFile false /Description > /Namespace [ (Adobe) (Common) (1.0) ] /OtherNamespaces [ > /FormElements false /GenerateStructure false /IncludeBookmarks false /IncludeHyperlinks false /IncludeInteractive false /IncludeLayers false /IncludeProfiles false /MultimediaHandling /UseObjectSettings /Namespace [ (Adobe) (CreativeSuite) (2.0) ] /PDFXOutputIntentProfileSelector /DocumentCMYK /PreserveEditing true /UntaggedCMYKHandling /LeaveUntagged /UntaggedRGBHandling /UseDocumentProfile /UseDocumentBleed false >> ]>> setdistillerparams> setpagedevice


Recommended