A Brief Guide to Building a Chatbot (You don’t need to be an expert!)
There are so many fields in Artificial Intelligence that we sometimes find ourselves in a dilemma over choosing the right field to dive into. Fortunately, there are services out there that let us test different concepts without expert knowledge or prior experiences. As the title suggests, I am going to explain how you can build a Chatbot without knowledge in Machine Learning nor Natural Language Processing. However, understanding the keywords and fundamental concepts will definitely help while you are building something. (Important! Some programming knowledge is required.)
Before we begin, go ahead and create an account over at Twilio’s and log into its console. There are a lot of things you can do with Twilio, but for this example we will only be using Twilio’s Programmable SMS (WhatsApp), Functions and its Autopilot platform.
Once you have logged into the console, you should see a dashboard similar to the image below. Click on the button with three dots (circled red) and it will bring up a long list containing the items we need (Programmable SMS, Autopilot and Functions). I’d recommend pinning them at the same time like what I did for ease of access later.
First of all, we need to initialize the WhatsApp Sandbox in Programmable SMS by following the instructions provided (highlighted). We will be given a number with which we can connect by using a specific ‘join’ code. This number will function as our Chatbot (you can play around with it using Twilio’s functions, but they are not ‘smart’ yet).
Next, let us head over to Twilio’s Autopilot and check out the actual model that we will be building. Here, we can click on ‘Build a Bot’ to view the templates for various circumstances (you can get a glimpse of how the model works!).
Take ‘Hospitality’ as an example (image below), there are various tasks which the model performs and also samples to train the model.
Once you are satisfied, go to ‘Your Bots’ and create a bot with the template of your choice. You can explore how to program the bot by referring to Autopilot’s API documentation.
Technically, everything is done at this point except we need to connect the Autopilot bot to our number in the WhatsApp Sandbox. However, if we want more control over the tasks that the bot performs (especially data collection) we can actually route them to a ‘function’ we have created. This gives much more flexibility and customization to our tasks.
The process is simple — assign a ‘redirect’ action with the URL to your function in Twilio’s Functions. Alternately, you can click on the ‘Actions URL’ (highlighted) and simply replace the existing URL with the function’s URL. The video below shows us how to use Twilio’s Functions with Twilio’s Autopilot.
And now for the final step, we just need to connect our bot to the WhatsApp Sandbox’s number. Head over to the ‘Channels’ section and click on the ‘WhatsApp’ channel and copy its URL.
Then, head over to your WhatsApp Sandbox and replace or paste in the copied URL. Give it a few minutes and voila, you should be able to test your Chatbot via WhatsApp!
Note: You should probably provide the model enough samples for each tasks and train them before trying via WhatsApp to avoid disappointments. :D