Advertisements

Creating a Chat Bot with Microsoft’s QnA Maker and Azure Bot Service

Image

Microsoft has a service in preview, called QnA Maker. It is a free (presently) service, which provides a REST and web-based service that trains AI to respond to questions asked of it. You’ve seen these on other sites, as these have become quite common, and ease the burden on support for SharePoint, or any other service out there. Chat bots can field common questions, freeing up time and energy spent on answering common asks.

They make it very easy to use – you can point it to a URL, type in your questions and answers, or upload a document (.docx, .doc, .pdf, .xlsx, and .tsv). The tricky part, is getting this from loading your knowledge base, to actually having a chat bot on your site. This is what this blog post is for, is to show you how to do it. They do have directions, but not a full walk-through on what to do.

This post assumes that you have at the very least, an Azure Account. If not, you can start one for free.

QnA Maker Setup

First, go to http://qnamaker.ai, this is where you will get started. Click on Create New Service

image

Then sign in with a Microsoft ID, or organizational account like you would into Azure, Office365, Outlook.com, etc.

image

It will then ask you to provide permissions to QnAMaker, click Accept

image

Then you must agree to the terms and privacy statement, check the box and hit Continue

image

Enter in a name for your bot. I am choosing Testbot 9001

image

You now have 3 options for loading data into your Chat Bot…

  1. From a URL that links to a resource which has a clear Q&A format, like a FAQ
  2. From a file, in Question/Answer format (supported file types are .TSV*, .PDF, .DOC, .DOCX, and .XLSX format)
    *TSV stands for Tab Separated Values. Like a CSV, but, you know, with Tabs. You can do this in Excel.
  3. Enter them in manually

For our Testbot 9001, we will be uploading from Excel. So, let’s create a new Excel file. In the first column, type in the question, or phrase, which the chatbot AI will hit on and use to provide the answer. Use the second column to provide that answer. Here is my example file:

image

Now, save the file. And go back to the QnA Maker setup, and choose Select file… next to the FILES section

image

and select the XLSX file from your local computer you just saved

image

Then scroll to the bottom and select Create

image

You will then see a dialog window appear while the service scans your file, and imports your Questions and Answers
image

Once complete, it will take you to the Testbot 9001 Knowledgebase.

image

Select Test from the side bar, and you can test the functionality with your questions
image

Cool, huh? The testing also allows you to train the bot as well. Such as choosing the best answer based upon what you had typed
image

Or providing multiple alternative phrasings, or synonyms

image

When done, click Save and Retrain to save your changes

image

You can see back in the main Knowledgebase, that it has been updated by what we asked and what we updated the suggestions and phrasings with

image

You can also add new Q & A pairs by clicking on Add new QnA pair

image

image

When done, Save & Retrain again to save your settings.

Once you are ready… click Publish

image

It will then show you what will be published… and then when ready, click Publish

image

The deployment confirmation screen will show you the example HTTP request for using your bot through the REST API. These are also available in the Settings link on the sidebar of the Knowledgebase.

image

We will need some f this information in a few minutes, so take down the Knowledgebase ID

image

And the Subscription Key

image

and put those aside for a few minutes…

Azure Bot Service Setup

Next we’re going to use the Azure Bot Service to setup our bot. To do so, we’ll be following these instructions: https://docs.microsoft.com/en-us/bot-framework/bot-service-quickstart

Log into the Azure Portal

Click on New > AI + Cognitive Services > Web App Bot

image

Now, let’s configure the botimage

  • Name: Testbot9001
    So you can identify the soldiers in your bot army!
  • Subscription: GeoffOps
    Choose your own subscription. This one is mine. You can’t have it.
  • Resource Group: Testbot9001
    Use an existing or create a new one
  • Location: East US
    Select the data center region you would like to use
  • Pricing Tier:  FO (10K Premium Messages)
    This defaults to S1 Standard, change this to F0 Free. Or else you will pay for the service
  • App Name: Testbot9001
  • Bot template:  Question and Answer
  • App service plan/Location: Testbot9001
    You will need to create a new one, or use an existing. For this example, I created a new one also in East US
  • Azure Storage: testbot9001a325
    I am letting Azure create a new one for me. This is a data storage account, like a fileshare. You can use an existing one if you have one as well.
  • Application Insights: Off
    This is not free. So I turned it off.

Then click Create to bring life to your Azure Bot. I twill validate your choices, and then when complete, will begin deployment.

image

When deployment has completed, you can find the bot and associates Azure resources under the All Resources blade of the left, or, if you have other stuff in Azure, go to the Resource Groups blade, and click on your Resource Group we created in the Bot setup above. In my case, the Resource Group is Testbot9001

image

Ok. So, we’ve created our bot with QnA Maker, and created a Bot Service in Azure… now what? We need to connect the two.

Select your bot, it’ll be the one which has a TYPE of Web App Bot

image

On the left hand side, click on APP SERVICE SETTINGS > Application Settings

image

And then scroll down to App settings. You will see two blank settings called QnAKnowledgebaseId and QnASubscriptionKey

Now, remember those things we copied off earlier? Pate these in there.

image

And then click Save up top

ScreenClip

Now, click on Test in Web Chat on the left side, and test out your new bot!

image

Pretty neat! But… now what?

Click on Channels on the left side. You will see Web Chat setup and running by default. You can also see, you can extend this out to Teams, Skype, and more pretty easily.

image

Click on Edit, and copy the Embed Code

image

And show one of the keys at the top

image

and replace the YOUR_SECRET_HERE in the embed code

image

And you can now drop that into a site, web part, whatever you’d like. It’s just an iFrame, so the possibilities are endless.

A simple example – using Embed Code on a SharePoint page:

image

image

image

Would I implement it like this for a client? Likely not… I’d be more apt to have a sliding pop-up window, similar to Facebook chats that can be minimized and maximized as needed. This was just an example to show how to build one of these.

 

References

Advertisements

April 2014 #CollabTalk TweetJam On Social Influence

Join me, and a host of other SharePoint experts on Tuesday, April 29th at Noon EST for a TweetJam to discuss Microsoft’s Strategy for Social Influence

Below is a re-post from Christian Buckley’s blog:

April 2014 CollabTalk TweetJamIt’s time once again for my monthly #CollabTalk tweetjam scheduled for April 29th at 9am Pacific / 12pm Eastern focusing on the theme of “Microsoft’s Strategy for Social Influence” which is a supporting activity for a panel event I’ll be running at the European SharePoint Conference on this subject next month. I ran a tweetjam on a similar topic last summer, but wanted to touch on the topic once again because of the ESPC panel – and because we now have more details on Microsoft’s social strategy following the SharePoint Conference in Las Vegas last month. Specifically, Microsoft announced their new OfficeGraph technology, which plays a key role in the company’s efforts to identify, utilize, and measure social influence through various “listening” tools within the business and productivity platforms we use every day, like SharePoint, Outlook, Yammer, Dynamics CRM, and of course from our use of the internet to search, communicate and collaborate. It’s pretty simple – to identify social influence and do something with it, you need to track social activities….so OfficeGraph is a HUGE step in the right direction, and I’m pretty excited to see Microsoft innovate in this area.

If you’re new to the tweetjam model, basically its an hour-long public conversation held on Twitter and using a shared hashtag (or as @sebmatthews would call it, “a shared octothorpe metadata field”) which is #CollabTalk. You can use your Twitter platform of choice OR go over to http://twubs.com/CollabTalk which automatically appends each message with #CollabTalk, and has a nice feature that allows followers to actually slow the dialog down to a readable speed (it can fly by fairly quickly). The questions we will be discussing are listed below:

"Microsoft’s Strategy for Social Influence"

  • Q1: How is social influence impacting collaboration and search?
  • Q2: Is social influence important within the enterprise?
  • Q3: How are organizations tracking and measuring social influence?
  • Q4: What are your thoughts on Microsoft’s social roadmap?
  • Q6: What are the logical “next steps” for OfficeGraph?
  • Q7: Is social changing the direction of Microsoft’s business and productivity platforms?

As always, we will have a panel of experts on hand to help seed the conversation – but anyone can jump in and participate. That’s the point – we want to encourage people to share their perspectives, so don’t be shy. Our panel this month will include:

  • Marwan Tarek (@marwantarek), SharePoint MVP and principal technology strategist at BrightStarr
  • Jussi Mori (@JussiMori), SharePoint MVP, social expert and consultant at Peaches Industries
  • Barry Jinks (@BJinks), founder and ceo at Colligo
  • Jeff Shuey (@Jshuey), director of strategic alliances at Gimmal
  • Geoff Varosky (@gvaro), senior consultant at Jornata
  • and myself as your host and moderator (@buckleyplanet), SharePoint MVP and chief evangelist at Metalogix

I’ll add to this list of panelists as I confirm them in the next day or two, and am excited to once again have a lively debate. We’re also doing something slightly different this time around – we’ll have a number of our panelists live via Google Hangouts, allowing viewers yet another way to participate, watching us as we “simulcast” the tweetjam via video. I’m not sure how it’ll turn out, or if it will provide any additional value – but we’ll try anything once, and it should be fun!

Mark your calendars, tell your colleagues, and get involved!

The Top 3% of Most Viewed on SlideShare in 2013!

image

Found out a couple of weeks back that my content just happens to be in the top 3% of content viewed on SlideShare in 2013! Pretty cool statistic. Click the link above to see what presentations were the most popular, and to browse my content on SlideShare.

image

image

One of the neater utilities I have come across lately…

On twitter last night, Ruven Gotz had posted a link for a utility from The Garage, called Mouse Without Borders.

image

That’s all I will say on the topic, just watch the video, then download and install… absolutely amazing, and it works wonderfully.

http://blogs.technet.com/b/next/archive/2011/09/09/microsoft-garage-download-mouse-without-borders.aspx

Thanks Ruven!

Microsoft SharePoint 2010 Firestarter Event in Waltham, MA.

image

I was at a “User Group for User Groups” (VERY simplified version – more on that to come soon!), and found out from our local Microsoft Evangelists, Chris Bowen and Dan Stolts, that there are some great local Firestarter events. These are described, on the site, as “Heat up your skills with the all-new Firestarter event series. Each day tackles a single Microsoft technology, including free sessions presented live by Microsoft developer and IT pro evangelists and technology specialists – with special appearances from community luminaries. Attend in person, via live meeting or download the webcast at your convenience.”

I am always interested into attending and participating in any event around SharePoint, especially if they are local, so, I wanted to help spread the word about this particular one. There are Firestarter events for Azure, Windows 7, ASP.NET, Windows Phone 7, and Silverlight. Basically, all of the new good things that have come out from Microsoft recently.

So, head on over to http://www.msdnevents.com/firestarter/ for more information and to register. And, if you are not in the Boston Area, they are happening elsewhere too. If you are in the Boston area, well then maybe I will see you there! Oh, and it takes place on December 2nd at the Microsoft Waltham office.

%d bloggers like this: