DDD is a great conference which is an inclusive non-profit conference ran by the community. I was so lucky this year to be part of this awesome conference and present our lovely Episerver which most of the developers there never heard of it! Means we need to create a better community out there. I presented Episerver CMS Headless and to spice it up added Microsoft Cognitive Services. My aim for the talk to build a website that can serve user as a Bot as well. To achieve this I used Episerver CMS as backend and Headless part to expose CMS data:
And used LUISE to interpret users request and Microsoft Cognitive Service to route the request as the picture below:
Santa is the user by the way!!!
To recap how this is working is Microsoft Web Bot is part of Cognitive Service and allow the user to interact with your application using different channels. So you don’t need to worry about exposing your app to different channels (e.g. Cortana, Microsoft Teams, Skype, Online Web Chat, ..). How? As below:
You just need to implement one function to get the data from user:
And Bot Service will send you all you need as an Activity if you want to read more detail about it read here. And what we do is get what user asked and process it.
First Step would understand user’s intent, so we need AI and as I’m lazy and love online services I would use LUIS which is Language Understanding online tool from Microsoft. The way it works is quite simple:
- Intent -> User goal
- Entities -> Keywords that our application cares
Input: Book me a flight to Cairo
- Intent -> “BookFlight”
- “cairo” – “location”
So you may ask how the hell LUIS knows what is “BookFligh” and how to it knows the entities. In a short-term, you need to teach LUIS! How? Read here.
Now we know what user wants and knows all related keywords, so the next step is using Episerver Headless CMS API to fetch what user wants:
if you like to read more detail about it you can reference Episerver documentation or a series of my blog posts. Bellow is how it looks like:
And rest is easy! Just interpret the data and return it back to the client. You can get the whole source code using links below:
Episerver CMS: https://github.com/zanganeh/SydMeetup.PlacesDirectory
Cognitive Service: https://github.com/zanganeh/SydMeetup.PlacesDirectory.Bot
And if you are interested in the presentation please find it here