HACKER Q&A
📣 jakobov

Recommended reading for building a chatbot?


I need to build a basic chatbot for a side-project. Ideally I am looking for a guide for hackers.

Google is not returning any relevant results, just marketing spam...

Any suggestions?


  👤 eindiran Accepted Answer ✓
I assume you want to use a text interface rather than a voice interface?

Do you have any constraints on the programming language you'll use? I'm going to assume that you'll be okay using Python in my answer.

If you were looking in to a voice interface, I'd highly recommend checking out "Designing Voice User Interfaces: Principles of Conversational Experiences" by Cathy Pearl[0], but you should know it's not really a how-to guide for hackers, but a set of principles for designing the interface/what the user experience should be like.

For text-based interfaces, there appear to be a few similar books, but I haven't read any of them and can't recommend them. For example, see "Designing Chatbots: Creating Conversational Experiences" by Amir Shevat.[1]

For the technical/implementation side of things, I'd recommend that you start searching using search terms like NLP and NLU, rather than "chatbot" on its own. A great place to start is with a toolkit like Rasa or spaCy for Python and look up some tutorials on how to use them.

If the chatbot is quite basic, I'd recommend starting with bare spaCy and using the built-in models. A tutorial like this should get you started: https://apps.worldwritable.com/tutorials/chatbot/

If the required bot is a little more involved, you can use Rasa NLU as well. Check out this tutorial for an example: https://towardsdatascience.com/building-a-conversational-cha...

Are there any particular things that you know your chatbot will need to be able to do? Extract and recognize product names in the user's response? Handle ambiguity/anaphora resolution? Respond correctly to commands and questions from the user? The behaviors you want from your bot will help shape how you go about building it, so if you can give me a better idea of what you need, I can give you more specific advice on that front.

[0] https://www.amazon.com/Designing-Voice-User-Interfaces-Conve...

[1] https://www.amazon.com/Designing-Bots-Creating-Conversationa...


👤 peterbozso
The Microsoft Bot Framework is a code-first bot creation tool: https://dev.botframework.com/ The learning curve is steeper than other similar solutions', because you actually need to write code, but if you are familiar with C# or JS, the possibilities are much wider than with the others. The official docs are pretty good, in the design section it also explains some base concepts of conversation design, not just how to use the SDK-s: https://docs.microsoft.com/en-us/azure/bot-service/bot-servi...

👤 turbo_fart_box
Dialogflow + Manychat + serverless. Use that as your build platform and spend time building something usable then writing tonnes of code. Manychat has some nice videos too

👤 gitgud
I learnt a lot just looking and hacking at these [1] Glitch examples, all sorts of methods used here not just a single library/technology stack...

[1] https://glitch.com/@glitch/bots


👤 cdnsteve
Have you checked out dialogflow from gcp? Can get up and running really quickly.