My first encounter with Artificial Intelligence (AI) in a practical sense came about four years ago when I oversaw the development of an iOS application that performed some narrow AI functionalities including converting speech to text and gleaning some useful user insights.
Since then, I’ve been exposed to more facets of AI, and am fascinated with the underlaying technology and the possibilities it presents to solve some big and complex issues across a myriad of industries. See my live chatbot demo later in this post.
So, what exactly is AI? It is an umbrella term in computer science for computing devices that imitate human intelligence. When we dig deeper, we find two of the most prominent subsets of AI: Machine Learning (ML) and Natural Language Processing (NLP).
To put it succinctly, ML is about machines (software systems) getting trained to solve problems by being fed specific types of data through supervised or unsupervised learning. Understanding these two training methods requires a deeper technical discussion, which I hope to cover in a future post.
NLP, on the other hand, is concerned with systems learning to comprehend and respond in human languages. NLP is divided into a number of sub-tasks such as Tokenization, Part of Speech (PoS) Tagging, Lemmatization, and Stemming. Both ML and NLP technologies together make up majority of AI implementations that are in use today across many different industries.
Some of the notable implementations of AI are found in self-driving cars, fraud detection, automated stock trading, personalized recommendations, email auto-complete, Apple Siri, Amazon Alexa, Google Assistant, among many others.
Perhaps one of the less glittery but very powerful implementations of AI is found in the online customer service space. Chatbots are one example of such implementation where businesses can save a lot of time and manpower by letting trained bots chat with customers to take care of common questions and repetitive tasks. And when bots encounter questions that they haven’t yet been trained on, they simply hand them off to actual customer service representatives. Bots continue to learn from past customer chats and gain better intelligence over time, gradually making them more capable to handle increasing amounts of work.
The barrier to entry in implementing chatbots has eased as major cloud services including Google Dialogflow, Amazon Lex, IBM Watson, Microsoft Azure Bot, and others now offer underlying infrastructure right out of the box.
Chatbot Demo
Let’s spin up a chatbot for a fictitious Acme Corporation, and train it to tell customers the hours of operation and make appointments. For this demo, we are going to use Dialogflow, a Google service. Dialogflow has excellent documentation to get you started. In fact this demo is a permutation of one of their samples.
Step 1: Login to Dialogflow with your Google credentials, and click “Create Agent” to initiate the bot creation process. Name the agent “AcmeCorporation”.
Step 2: Click “Default Welcome Intent” and navigate to “Responses”. Delete all default responses and create a new response, “Welcome to Acme Corporation. I can help you set up an appointment or tell you our hours of operation. How may I help you?” In a real-world application, you would add more greeting variations, allowing the system to pick one randomly every time. Click “Save”.
Step 3: Click “Create Intent” and name it “Hours”. Click “Save”.
Step 4: Go to “Training phrases” and enter several variances of likely user expressions such as “What are your hours?”, “Are you open today?”, “When do you close?”, “Business hours”, and “What time do you open tomorrow?”. Be sure to save each entry.
Step 5: Scroll to “Responses” section and enter, “We’re open from 8 a.m. to 5 p.m. every day. Is there anything else I can help you with?”
Step 6: Create a new intent named “Schedule Appointment”.
Step 7: Go to “Training phrases” and add, “I need to make an appointment at 2:30 PM today.”
Step 8: Scroll to “Action and parameters” and add @sys.date and @sys.time as per the screenshot below.
Step 9: For $date, click “Define prompts” and add, “Sure, what day do you want to come in?”. Similarly, for $time, click “Define prompts” and add, “What time?”.
Step 10: Scroll to “Text response” and add, “Got it. Your appointment is scheduled on $date at $time. See you soon!”
Step 11: Go to “Integrations” and click “Web Demo”. You can now test the newly created bot (agent) on its own page via the provided URL, or embed it to your website using the IFRAME code.