{"id":15850,"date":"2018-08-21T13:42:00","date_gmt":"2018-08-21T20:42:00","guid":{"rendered":"https:\/\/devwww.3cloudsolutions.com\/post\/cognitive-services-showcase-api-knowledge-tools-2\/"},"modified":"2024-01-03T14:32:07","modified_gmt":"2024-01-03T22:32:07","slug":"cognitive-services-showcase-api-knowledge-tools","status":"publish","type":"post","link":"https:\/\/3cloudsolutions.com\/resources\/cognitive-services-showcase-api-knowledge-tools\/","title":{"rendered":"Cognitive Services Showcase: API Knowledge Tools"},"content":{"rendered":"<p>Over the past couple months, we&#8217;ve highlighted some of the most useful and popular <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/cognitive-services\/\">Microsoft Cognitive Services<\/a> such as Search, Vision, Speech, and Language. Our final post in the series is about the Knowledge service and its capability to intelligently deploy resources like Question and Answer (QnA) and FAQ content where they are needed most. In this article, we\u2019ll cover some of the basics for getting started, and some examples of how this service can be used by itself and in combination with other Azure components. Before we get into the details of the Knowledge service, let&#8217;s review the business value of AI and Cognitive Services in general.<\/p>\n<p><!--more--><\/p>\n<p><img decoding=\"async\" style=\"width: 805px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/Banner_Knowledge.png\" alt=\"Banner_Knowledge\" width=\"805\" \/><\/p>\n<p>Microsoft\u2019s Cognitive Services provide artificial intelligence (AI) capabilities \u2013 which is essentially the ability of a machine to learn from experience and perform a task normally requiring human intelligence. The most popular AI applications are around vision, speech, and text processing \u2013 such as identifying objects in a picture, translating speech to text, or extracting the most common or useful parts of a body of text. I like to think of this as converting unstructured data into structured data that is more easily mined for information and insight.<\/p>\n<p>These capabilities represent tremendous value, but have traditionally been difficult to deploy directly in support of a business function. They are complex and expensive to develop manually (usually requiring data scientists) and can be challenging to integrate into applications. Microsoft Cognitive Services relieves this pain by acting as the central intelligence components of an <em>AI Oriented Architecture<\/em> on Azure, where the complex data science elements come pre-built, you can couple many different services together, and easily deploy the architecture where your customers are most likely to use it. It\u2019s a microservices pattern for AI.<\/p>\n<p>I\u2019ll use a crawl-walk-run approach to show how your organization might use the Knowledge Cognitive Service in increasingly powerful ways.<\/p>\n<h2>Crawl<\/h2>\n<p>Writing this blog was my second opportunity to use MS Cognitive Services. I\u2019ve used the Vision service with a client before and was very impressed with how easy it was to get started and demonstrate accurate object recognition in photos in just a couple hours. I had a similar experience with the Knowledge service, and as a bonus, got to learn about and create a Bot! The Knowledge service consists primarily of the <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cognitive-services\/qnamaker\/overview\/overview\">QnA Maker<\/a>, which \u201cenables you to power a question and answer service from your semi-structured content like FAQ (Frequently Asked Questions) documents or URLs and product manuals. You can build a model of questions and answers that is flexible to user queries, providing responses that you&#8217;ll train a bot to use in a natural, conversational way.\u201d<\/p>\n<p>The value here is taking a variety existing knowledge resources \u2013 whether they are on a website, in product manuals, text files, or other documents \u2013 then putting them all together to form a unified and interactive question and answer service readily available to users. This is a great way to help employees or customers quickly find answers they need about products or services across distributed sources, without using valuable human resources to answer repetitive questions. Here\u2019s a <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cognitive-services\/qnamaker\/overview\/overview\" target=\"_blank\" rel=\"noopener\">sample architecture<\/a>:<br \/>\n<a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cognitive-services\/qnamaker\/overview\/overview\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" style=\"width: 984px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/architecture-diagram-1-1-1.png\" alt=\"architecture diagram 1-1\" width=\"984\" \/><\/a><\/p>\n<p>I developed my own QnA Maker service and here is my experience. I got started at <a href=\"https:\/\/www.qnamaker.ai\/\" target=\"_blank\" rel=\"noopener\">QnA Maker<\/a>. If you\u2019d like to create your own service, make sure you have an <a href=\"https:\/\/azure.microsoft.com\/en-us\/get-started\/\" target=\"_blank\" rel=\"noopener\">Azure account<\/a> (free trials are available). Once logged into the QnA Maker portal there are three primary tasks, all accomplished <em>without coding<\/em> and using nice user interfaces (UIs) in the QnA and Azure portals:<\/p>\n<ol>\n<li><strong>Create a QnA service in Azure.<\/strong> This provides the engine to extract question and answer pairs, as well as publish your service endpoint.<\/li>\n<li><strong>Populate a knowledge base.<\/strong> Use the QnA Maker interface to add existing URLs or files with question and answer pairs. There are <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cognitive-services\/QnAMaker\/concepts\/data-sources-supported\">lots of options for data sources<\/a> \u2013 so no need to re-create existing FAQs! I spent 5 minutes typing some simple questions and answers into a plain text file and it worked perfectly. You can also manually add Q and A pairs in the interface.<br \/>\n<img decoding=\"async\" style=\"width: 679px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/knowledge-base-1.png\" alt=\"knowledge base\" width=\"679\" \/><\/li>\n<li><strong>Connect your service to your knowledge base.<\/strong> This aggregates the sources you provide to create one knowledge base and enables an API (application programming interface) endpoint \u2013 usable in your own applications, third party chat channels like Skype, Slack, and Facebook Messenger, or with something pre-built like a Microsoft Bot.<\/li>\n<\/ol>\n<p>Once you\u2019ve completed these steps, you\u2019re guided to other activities like testing and training your knowledge base, or connecting to a bot. Let\u2019s look at both.<\/p>\n<p>You\u2019ll notice in my sample questions and answers in the screen shot above that I have a question \u201cWho is the speaker?\u201d Using the test feature in the QnA portal, I can get the correct answer. But modifying the question to \u201cWhat is the presenter\u2019s name?\u201d provides no good match.<\/p>\n<p><img decoding=\"async\" style=\"width: 401px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/speaker-name-1.png\" alt=\"speaker name\" width=\"401\" \/><\/p>\n<p>Using the UI, I can easily provide an answer to this new question and\/or provide alternative phrasing for the question. Adding my name as a new answer worked as expected! You can also update your documents and refresh \u2013 so it\u2019s easy to update your knowledge base with files, or through the UI.<\/p>\n<p><img decoding=\"async\" style=\"width: 1205px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/speaker-name-2-1.png\" alt=\"speaker name 2\" width=\"1205\" \/><\/p>\n<p>Now, what about making the Knowledge service available to users interactively? This is a job for a bot. Once I finished making my Knowledge service, I was provided <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cognitive-services\/QnAMaker\/tutorials\/create-qna-bot\">instructions to build a QnA Bot<\/a>. I did this on the Azure portal, and from there I was able to connect my shiny new bot to my existing QnA Maker service and test my knowledge base. There\u2019s also great <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/bot-service\/bot-service-manage-channels?view=azure-bot-service-3.0\">documentation for connecting your bot to channels<\/a> like Facebook, Skype, Slack, and others.<\/p>\n<p><img decoding=\"async\" style=\"width: 808px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/chat-bot-1.png\" alt=\"chat bot\" width=\"808\" \/><\/p>\n<p><img decoding=\"async\" style=\"width: 808px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/chat-bot-2-1.png\" alt=\"chat bot 2\" width=\"808\" \/><\/p>\n<p>Whew! That\u2019s quite a bit just to learn to crawl. But going through the QnA Maker creation process was relatively simple, and very rewarding. I can already see how I might use this on a current DevOps project to provide quick project answers across business, IT, development, and data science teams. The Walk and Run sections are shorter, but demonstrate how we can group multiple Azure components together with the Knowledge service.<\/p>\n<h2>Walk<\/h2>\n<p>Once you\u2019ve seen a knowledge base in action, you might wonder, \u201cWhat about a QnA service when there are many different domains of knowledge \u2013 such as separate business units or specialty areas?\u201d Glad you asked! Within the service, you certainly could create one knowledge base with all the disparate domain content, but that could be difficult to maintain among a diverse set of curators. Azure has a better way, using the <a href=\"https:\/\/www.luis.ai\/home\">LUIS (Language Understanding) service<\/a>.<\/p>\n<p><img decoding=\"async\" style=\"width: 704px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/walk.png\" alt=\"walk\" width=\"704\" \/><\/p>\n<p>In the diagram above, several areas of knowledge, such as Payroll, HR, and Finance, all have separate knowledge bases (KB) within a single QnA service. To provide a single point of access to all three KBs, LUIS is used to take an initial user question and determine where it should be routed. This is a great example of the power of AI; to take a natural language question and distill it into a smaller \u201cpackage\u201d \u2013 like a single word or phrase \u2013 so that it can be related more easily to other data. In this case, a LUIS service is trained to recognize these distinct areas, and then call the appropriate knowledge base endpoint. As you might expect, all of this can be handled seamlessly within one Azure bot. This is a simple but powerful example of an AI Oriented Architecture. You can read more about <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cognitive-services\/qnamaker\/tutorials\/integrate-qnamaker-luis\">integrating LUIS and QnA here<\/a>.<\/p>\n<h2>Run<\/h2>\n<p>Our final example is the most comprehensive use of the Knowledge Cognitive Service paired with other Azure components, and was recently featured in a MS Machine Learning blog about <a href=\"https:\/\/blogs.technet.microsoft.com\/machinelearning\/2018\/07\/31\/3-steps-to-build-your-first-intelligent-app-conference-buddy\/\">building a Conference Buddy intelligent app.<\/a><\/p>\n<p>The scenario: users at a conference presentation wish to learn more about the speaker and\/or the speaker\u2019s content, but don\u2019t have the opportunity to directly ask \u201clive\u201d questions. For example, an attendee might want to access the speaker\u2019s bio by asking a question in a simple interface, rather than following a series of links on web pages. Or attendees may ask questions about the presentation topic that weren\u2019t covered during the talk and want focused results, like a video that just plays the portion relevant to their question. The speaker also wants to know what questions the audience is asking.<\/p>\n<p>All of this can be handled by grouping the Knowledge service with LUIS and other services like Bing Search, Text Analytics, and Video Indexer, then presented to audience members in a chat (bot) interface. The speaker can have a dashboard to monitor all the questions in real time. The bot greets attendees like this:<\/p>\n<p><img decoding=\"async\" style=\"width: 600px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/run.jpg\" alt=\"run\" width=\"600\" \/><\/p>\n<p>Behind the scenes, there are multiple services configured to handle the different question types. You can review the full architecture on the blog, but it is analogous to our previous example of having LUIS route the question intent to the appropriate knowledge base within the Knowledge service. In this example, however, we use LUIS to route among multiple Cognitive Services and Azure functions.<\/p>\n<p><img decoding=\"async\" style=\"width: 1106px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/cognitive-services-1.png\" alt=\"cognitive services\" width=\"1106\" \/><\/p>\n<p>Finally, a speaker\u2019s dashboard can be built using an Azure web app to provide insights from attendees\u2019 questions. This could be shown on stage, provided to users, or just used by the moderator(s) to gauge interest and participation.<\/p>\n<p><img decoding=\"async\" style=\"width: 581px; display: block; margin-left: auto; margin-right: auto;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/speaker-dashboard-1.png\" alt=\"speaker dashboard\" width=\"581\" \/><\/p>\n<p>That\u2019s it! I hope this helped familiarize you with the power of Cognitive Services in general, and the Knowledge service specifically, in a variety of ways.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the past few months, we\\&#8217;ve highlighted popular Microsoft Cognitive Services, including Search, Vision, Speech, &amp; Language. Our final post in the series is about the Knowledge service &amp; its capability to intelligently deploy resources like Q&amp;A &amp; FAQ content where they are needed most.<\/p>\n","protected":false},"author":21,"featured_media":14253,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[260],"tags":[331,319],"class_list":["post-15850","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai","tag-cognitive-services","tag-machine-learning-ai","topics-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/15850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/comments?post=15850"}],"version-history":[{"count":0,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/15850\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media\/14253"}],"wp:attachment":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media?parent=15850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/categories?post=15850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/tags?post=15850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}