So I made a bot…

Chris L
4 min readAug 13, 2016

--

My job at Mercedes-Benz is intentionally mysterious. But I can say that it helped inspire me to investigate the weird world of chat bots. To help me get started, I asked my friend Sandi MacPherson about how she made her bot. Based on her experience, I followed suit and tried making one myself. It has not even been 24 hours yet, and it’s been quite interesting so far…

Easy to learn, difficult to master

Sandi built her bot based on John Borthwick’s bot, Botwick. If you follow along with the instructions on how to make one of these, it’s actually quite simple to make. With nearly zero technical understanding (and a small bit of cash), you can get one up and running in about 15 minutes.

After looking at the chat logs that I have so far, it’s really interesting to see how people are using it.

It’s really easy to learn how to make one and start answering basic questions. Where I find a lot of the complexity is in understanding how to design dialogues. See, we humans learn how to communicate with each other over a long period of time. Formulating ideas and concepts into sounds, sounds into words, words into sentences, and sentences that communicate the original idea is a skill that we develop even long after we learn to speak. So building a bot that can have a deeper dialogue than just answering a few one-off questions is far more complicated than it seems.

Dialogue Design

It boils down into 2 items: a series of intents, and the responses to those intents.

In as simple terms as I can say, an intent is basically the topic of the dialogue, along with the key words or trigger words that the bot needs to pay attention to. In more complex dialogue routines, it will include some NLU/NLP (natural language understanding or processing) to understand the intent without needing to always seed the intent with trigger words.

The response is simply how the bot should respond. This can accomplished in any number of ways. When designing a response, it is very important to consider the question the user is asking, along with the intent of the question so that you can ensure that the bot responds with in the right way.

Shallow and broad, or narrow and deep?

What I’ve learned so far is that you need to decide what your bot is going to be about. Why does this thing exist? What is it’s purpose in life? It feels a bit like playing a god where you have to decide what this little thing is ultimately going to do in its lifetime.

There are basically 2 approaches: broad but shallow, and deep but narrow. A broad but shallow bot is one that can answer a wide array of questions on any given topic, but without too much substance. An example would be like a short conversation with someone you just met and don’t intend to spend much time talking with.

On the flip side, a deep but narrow bot could answer numerous questions, but only within a specific topic. An example would be some kind of bot that answers questions on bikes and bike maintenance.

There’s no real right or wrong answer as to which style of bot you want to create, but like with a real person, deciding on what it will be can help you focus on designing the right kinds of dialogues.

Growing Pains

In John Borthwick’s post, he encourages you to borrow his data to base your bot on. I actually chose to start with a clean slate. Doing this means that you must put your bot through all kinds of tests to train it to speak better. Training a bot takes the form of having people talk to it.

In some ways, it’s much easier to start with an existing data set (like John’s) to help it be a bit smarter in the beginning. But again, this really depends on the purpose of your bot. What should your little bot buddy be when it grows up?

Ultimately it boils down to human behavior. In order to improve how a bot interacts, you need to understand human behavior and human psychology in some way. This is why shallow and broad chat bots are so complicated; a dialogue can really go in any direction. Any topic can be brought up, and with this kind of bot, if it is not designed to handle a particular dialogue step, the experience breaks, which can be disappointing. But it’s ok. Like an infant, it needs to learn how to interact, so as the parent of the bot, you have to expect some growing pains!

What’s next?

Well, chrisbot is here! He is still a little rough around the edges, but you can chat with him a bit. I need to work on his dialogue skills, and that’s where he needs to interact with more people. If you would like to ask him some questions, send a text to (650) 866–8990. Say “Hello” or ask him if you should have that last piece of cake for dessert! Let me know how it goes on Twitter!

--

--