
























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

























































companies have attracted $24 billion in funding towards the development of AI driven bot applications. [Gatti, Venturebeat, 2017] Microsoft CEO Satya Nadella was quoted saying “Bots are the new apps”.[Cava, USA Today, 2016] With Microsoft set on exploring deeper into the world of chatbots and accelerating the innovation and sophistication of chatbots, I’ve found this project both interesting and exciting as I dived into Microsofts newest platform; Microsoft Bot Framework. With many companies already creating their own bots using the Bot Framework such as Ebay, Skyscanner, StubHub and Foursquare, I believe that in the next few years every major business will have a chatbot to deal with customers’ basic queries and maybe even go as far as processing full orders. Chatbots have the potential to replace call centres, customers can get their queries answered simply by opening their favourite messaging platform and chatting with a bot. Introduction
The purpose of this project is to showcase the power of chatbots and how they can be an alternative to using an application or even a website. The chatbots should be easy to use, respond in a timely fashion and be all round user friendly. The bots should make the users interaction as easy and fast as possible to ensure that the users time is not wasted and that they get what they want without any difficulty or misunderstanding from the bot. The conversation should flow and always keep the user in control of the conversation. Users should come away from their experience with the chatbot and think that it was a fun, easy to use and straightforward interaction that would encourage them to come back without any hesitation. With messaging platforms being the most used type of application in the world, businesses will be looking to take advantage of this and start to develop their own
chatbots to work along with their social media pages. For example, a person calling a restaurant to see what time they open at or what is the special today, the customer can simply message the page on Facebook and the bot will respond accordingly. This frees up time for real employees to do other work and allows the chatbot to handle the simple tasks. Since users will already have a messaging app installed on their mobile device, there is no need to download a separate application to use the chatbot. This can turn a lot of users away as nowadays there is an plethora of applications available and most users will be fed up of having to download an application that they may only use once or twice.
This application will be developed using one of Microsoft’s newest frameworks; Microsoft Bot Framework. This framework allows for the bots to be built and deployed using Microsoft Azure. Once the bots are hosted on Azure they can be then hosted on various other platforms such as Facebook Messenger, Skype, Slack and more. For the purpose of this project, I will be mainly using Facebook Messenger as a platform to showcase the bots I’ve developed as it is easily available with the Messenger application and allows for easy testing. The bots themselves are developed using C# using the Microsoft Bot Builder packages. Microsofts LUIS is a language understanding and interpretation service that I’ve used to process the data which the chatbot receives and derive the intent from the users message. LUIS works by taking the users input and scoring it against its database of intents and then performing the function of the highest scoring intent. Users can have multiple ways of expressing a single intent and LUIS is there to figure out what the user wants to do. Multiple packages and APIs have been used in the development of this application including: SendGrid – Allows the sending of feedback emails entirely within the chatbot.
weather, time etc. They can even process orders and make bookings entirely through a chatbot interface. Chatbots are well suited for mobile devices as messaging is at the heart of a mobile phone. Messaging has come a long way since SMS messages became popularized in the 2000 s and is now on the decline. From the years 2011-2015 the usage of SMS in Ireland has dropped by 44%. 3 billion texts in 2011 compared to 1.7 billion texts in 2015. [John Hargan, killbiller.com 2015 ] Although SMS is experiencing a decline, this doesn’t mean that people aren’t sending messages anymore, it just means they are using different services. It is fast becoming the norm where a chatbot is easier to use than an application, and businesses are taking advantage of this. With automation looking to takeover manual labour and factory type jobs, chatbots are starting to make their way into the customer service sector. Call centre and customer service jobs whereby a human worker will work off a script and a set of answers to generic customer queries will soon be replaced by chatbots. Chatbots can be trained and equipped to deal with the everyday needs of a customer, and they can do so at a very little cost. It is also worth mentioning that chatbots can run 24/7 365, giving customers what they need even during the Christmas and public holidays. With the cost of the development of a chatbot ranging anywhere from $3,000 to $10,000, it would be a no-brainer for a company to implement chatbot services to their customer service department. [Oswalt, 2017] Inevitably, there will be situations where a chatbot will not suffice and a customer will have to be redirected to a human representative, but it is still a step forward in cutting down costs and automation. Another aspect of chatbots that should not be overlooked is the data they can collect. Chatbots are just another stream of data that companies can exploit benefit from. Chatbot conversations can provide everyday user scenarios that can be used for training material for human workers. Chatbots can be used to complete data sets by acquiring information from users. The conversations can be used a way to learn more about the user and build up an advertising profile that can then be used to for targeted advertising and promotions. From large multi-national organizations to the restaurant down the
road, the data a chatbot can collect can be helpful in identifying who your customers are and what they want. The infrastructure is there for chatbots to thrive as more and more people are using messaging apps every day. There is a wealth of APIs and platforms for chatbots to explore and make use of and bring interesting features and services to users.
Alice, short for Artificial Linguistic Internet Computer Entity, is a chatbot developed by Richard Wallace using AIML (Artificial Intelligence Markup Language). When I was first researching chatbots and how to develop them I came across AIML (Artificial Intelligence Markup Language). It’s an XML schema used to create intelligent chatbots. One of the world’s most known chatbots; A.L.I.C.E, short for Artificial Linguistic Internet Computer Entity, was developing using AIML. At first it seemed to be the best framework to develop my project on. There was lots of material online for me to read and get to understand how everything worked. I started work on my project using this language and made some progress but regrettably it just wasn’t going to work out. It was an old language initially released in 2001 and wasn’t very flexible. Basic conversations were easy to get up and running but accessing APIs and getting it hosted on social media platforms caused great difficulty. It’s archaic architecture didn’t stand up to todays modern platforms. I scrapped all of my work on AIML and moved to Microsoft Bot Framework which I stuck with for the remainder of the projects development. In hindsight, I should’ve moved on earlier.
In January I came across Microsoft Bot Framework and it looked like the perfect platform for my projects development. It supports development in C# and Node.Js. I have worked with C# on many college projects over the years and Visual Studio would be my preferred IDE, so this was a massive factor in deciding what framework I was going to work with. It allows you to connect your chatbot to multiple platforms at ease
Before I decided to work with Bot Framework, I also explored what other frameworks were out there. One of them was API.AI, which was recently acquired by Google. API.AI boasts a wide range of features with support for chatbots, wearables, apps, smart homes and even smart TVs. I started work using the framework but I soon discovered that a lot of the features available with it such as knowledge bases and API packages, were locked behind a paywall. I felt that it was more geared towards a development team and not really catering for a solo developer like myself. As I was just learning about chatbots and looking at my options I chose to stay away from API.AI mainly due to the premium only features. I also found that the documentation was not as easy to read as Microsofts Bot Framework. FIGURE 2 API.AI FEATURES Figure 2 above shows some of the features of their framework. They offer prebuilt bots that you can configure to your needs which would be useful but they are in fact locked
behind a paywall. I also felt that it would kind of take away the fun of working on a project as everything is already defined for you with this framework.
Like API.AI, Wit.AI is another framework I explored before deciding to use Bot Framework for my project. Wit.AI was acquired by Facebook, you can start to see the trend with all the major companies getting on board with Artificial Intelligence and language processing. Wit.AI works similar to the way Microsofts LUIS works by extracting the intent from a user’s message. This seems to be the direction most natural language processing entities are heading. With users seeking to use a chatbot solely for function instead of a conversation, deriving the intents of the user is the chatbots utmost priority. As well as API.AI, Wit.AI features support for bots, apps, smart homes, wearable devices and even robots. Wit.AI mainly focuses on users building their bots within their web client, a feature which I was trying to stay away from as I would prefer to actually write the code needed. As well as the web client, they offer documentation for development using Node.Js, Python and Ruby. All of which I am not too familiar with so this pushed me away from this framework and left me with Bot Framework. Bot Framework also supports Node.js but it has support for C#, a language I am familiar with and have used to develop many college projects throughout the years. FIGURE 3 FEATURES OF WIT.AI [WIT.AI]
This requirement requires the chatbot to work with Facebook Messenger. This requires the bot to be configured with a Facebook Page, obtaining a PageId, App Id, App secret and a page access token. All of this information needs to be fed into the Bot Framework website to get it configured for access with Facebook Messenger. This requirement gives the bot portability and cross platform functionally by giving it both access to Facebooks Mobile Messenger as well as the web client. From my market research, it was clear the users would like the bot to have a Messenger presence rather than a standalone app.
This requirement requires the chatbot to work on a web client. From my market research, it was noted that although the majority would prefer a mobile client, there was a number of people who would also like to see a web client for the bots. The bots need to be configured on the Bot Framework platform to allow webchat embedding. This is achieved by hosting the bots on my website located at: http://karlfyp.azurewebsites.net
This requirement requires the chatbot to function on a mobile device, in this case, using the Facebook Messenger application. It is required to work on both Android and iOS. This allows mobile users to avail of the chatbots services.
This requirement requires the chatbot to be configured with a LUIS account subscription. This handles the natural language processing of the bot and the routing of the dialogs. Once a LUIS account is set up and a language model is defined with intents and utterances, the model ID and subscription key can be entered into the RootLUISDialog class. This allows the bot to function using the services of LUIS. Code Segment FIGURE 5 REQ 5 CODE SEGMENT
This requires the chatbot to have a valid Computer Vision API key. This can be obtained from Microsoft Azure Service, once acquired it can be added to the Web.config file so it can be referenced by other classes. This allows the chatbot to access the Computer Vision API and make use of its services. Code Segment
This requires the chatbot to have a valid QnA Maker API key. A QnA service needs to be created and once it is established the knowledge base key and subscription key can be placed into the Web.config file where it can be referenced by the classes that need it. This requirement allows the bot to access the external QnA’s created on the service. Code Segment FIGURE 8 REQ 8 CODE SEGMENT
The main usability requirement is that the chatbot and website are user friendly. The chatbot, in its own nature is user friendly since it is a simple chat interface. Everyone knows how a chatbot works as it is simply like a conversation with their friends. The messages come in on the main screen and there is a text box at the bottom to type in and a send button. Users must feel comfortable in the conversation and feel in control. To guide the users through the conversations, help messages should be in place to aid the user if they so happen to get stuck or are unsure of what to do. An example of this can be seen with the Pizza bot. If a user types “help”, the following message will be displayed: FIGURE 9 PIZZA BOT HELP MESSAGE This allows the user to view information about the option they are currently at and how they can answer. It tells the user how they can go back, quit, view the status or switch to another option. This more than meets the requirement of letting the user be in control of the conversation. Inexperienced or low skilled users will easily be able to navigate the Pizza bot with the help of the help menu. To ensure that users know about this feature,