Answers Chat bot for your WordPress blog

Introduction

Chat based interfaces, backed by powerful AI (Artificial Intelligence), is an effective way to connect with your customers. For decades thousands of brilliant and dedicated scientists have collaborated to create AI and Language Processing to construct automated systems for the betterment of humanity. More recently Microsoft wrapped this magic in tooling that makes it accessible to the less sophisticated masses (and .net developers)

When blogging became popular a number of companies sought to ‘commoditize’ the complexity of setting up a server and running custom website software. WordPress is the undisputed winner of ‘personal blog software’. What WordPress has done for websites and content management Microsoft is doing for AI. The haven’t won yet, Amazon, IBM and others are all in this together. I’m working on an Amazon bot in parallel to this so that I can compare and contrast the services.

In order for a chatbot to be useful, it needs data to provide. Microsoft has created a ‘Question and Answer’ service that provides for the common use cases. In many cities navigating the Office of Property Management is daunting task, so lets build a chatbot to help users get answers to the Philadelphia OPM FAQ

Once we have created the service, we will develop a quick wordpress plugin in order to connect the service to your blog.

Create a Microsoft Question and Answer Service

Login to MS cognitive services and create your QandA service

https://qnamaker.ai/

From the top menu click ‘create new service’. You will be promoted to login using an existing Microsoft account, or to create a new one.

Give your bot a friendly name and paste in a URL of a FAQ page for the service to scrape. You can also upload a data file or questions and answers, and there are API calls to add or refresh content from existing URLs.



Once the service has completed scraping the provided URL you will see a list of the questions and answers

on this screen you can edit and update questions and answers. Click the ’test’ option on the left to test out the chatbot and train it.

When you are satisfied with the results, click ’Save and Train’ and then ‘Publish’.

Before we can build the WordPress plugin, lets try a simple PHP script to ensure we have connectivity. In order to access the API, you will need 2 variables. The GUID of your knowledgebase and your subscriber key. The simplest way to get them is by clicking the ’settings’ tab and looking at the code sample provided:

test our a simple PHP script to connect to the service. Replace the {Knowledgebase ID} and {Subscription-Key} with the variables from your service.

You should now be able to test your bot using a web browser

http://Your Web Server/bot.php?question=how%20do%20I%20get%20a%20permit

Congratulations. You can now add Natural Language Processing, Machine Learning and AI to your resume 😉

In our next post we will create a simple WordPress plugin to easily access your new service.

Les Held on the Today Show

My father was featured on Hoda’s Bucket list segment on the Today show.

My dad never really wanted to talk about his past in public, but recently he met one of the soldiers from the US 30th Infantry who rescued him. With the passing of the last of the group who rescued him, he now wants to ensure his story is told. The today show segment didn’t go into detail of his rescue, but men like Matthew Rozell and Frank Towers have documented it here https://teachinghistorymatters.com/2016/03/01/the-last-transport/

http://www.today.com/news/80-year-old-dad-who-survived-holocaust-gets-ultimate-surprise-t102666

The Today Show did a great job of telling his story and I’m appreciate of the support he as gotten since.