Topics: AI | Data Science | Data Visualization | Deep Learning | Machine Learning | NLP | Python | R | Statistics

KDnuggets Home » News » 2017 » Sep » Opinions, Interviews » I built a chatbot in 2 hours and this is what I learned ( 17:n35 )

Silver BlogI built a chatbot in 2 hours and this is what I learned

  http likes 148
Tags: , , ,

I set out to test two things: 1) building a bot is useless from a business perspective and 2) building bots is crazy tough. Here is what I learned.

Grinding the bot

Building a chatbot was like solving a reasonably-sized jigsaw puzzle for me. I just had to find the right pieces and the tools needed to build it. While I had some of the puzzle at an arm’s length, I was still confused on where to start. I had a checklist of two items —

  • Bot should talk like a person: meaning that it should understand natural language.
  • Bot should be able to solve a non-trivial use case: meaning that it should do something that takes more than two steps to do in UI (business merit).

Keeping these constraints in mind, I wanted to establish credibility in my mind on whether bots are hard to build or easy to build. As I am a total newbie in natural language processing, I can imagine the learning curve to be same for most of us.

After listing through some problems, I finally chose to make a chatbot that correctly calculates dates from natural language strings. For example, it would accept inputs like “What is 6 days from now?”, “Give me 5 weeks after next September” and give me the date I am looking for.

A simple architecture for such a bot would be like this:

Following this tutorialI was able to make a intent classifier system using basic NLP and a softmax based neural net in less than 2 hours (that includes installing Tensorflow on my Windows machine). After the intent was determined, the string would be parsed for input giving me the date that I wanted. I would rather have the input date parsed and given to me by the NLP module too, but it works for now for proof of concept.

To be honest, it wasn’t that hard. With Facebook’s Messenger Platform andTelegram’s Bot Platform, abilities offered by, and — some of us might be able to do it faster than the route I took.

It has a learning curve. Agreed. But what doesn’t?

It was a very liberating exercise to learn something methodically and then go on ahead and make a working proof of concept. I was feeling good.

Salt and Pepper

Making a chatbot for my own personal use opened me to a world of possibilities. People are solving so many of their problems with clustered UI like booking travel tickets, hotels, movie tickets, ordering food, etc. The user experience can be improved by leaps and bounds by introducing a bot UI there. The newness of the platform really excites me, to be honest. It’s the age when new Facebooks and Whatsapps emerge out of darkness.

I believe in a world not far away in time, everything would be done via a conversational bot like in the movie, Her. It would be more efficient than even a single tap on your smartphone screen. I wouldn’t advise falling in love with your Samantha, though. ;)

Jokes apart, the chatbot play is definitely an emerging trend. Everyone is debating whether it would last or not. But trends don’t live or die by their own. It’s people that make or unmake them.

I believe hype is an instrument that brings obscurity into mainstream.The industry is just learning what all it can do with this relatively new tech. It’s a bet worth taking as a businessman and a skill worth learning as an engineer.

After all, the best bots are yet to be made.

Original. Reposted with permission.

Bio: Shival Gupta, Product enthusiast, entrepreneur and generally a nice person to be around. He is based in Bengaluru, India, tweets at @braveproductguy and blogs at


Sign Up

By subscribing you accept KDnuggets Privacy Policy