I have been building chatbots for past 3 years using existing platforms like Google's Dialogflow, Wit.ai, Recast.ai. Over the years I have fallen in love with open source frameworks and Rasa is one of the best to build chatbots. In this tutorial we will build 3 simple chatbots thereby understanding the basics and what differentiates chatbots webapps
- Echo bot - A bot that repeats whatever you say
- Google Search Bot - A bot that searches Google for you
- wordbot - A bot that gives you meaning and opposites
Each bot has it's own folder with Tutorial.md
file.
Any chatbot building consist of 3 parts
- Training your bot
- Writing your actions
- Giving a chat interface
This repo assumes you know python, if you don't learn basics of python and ML and get back here.
- python 3.7
- pip
- virtualenv
I use virtualenv
to create a virtualenv and create
pip install -r requirements.txt
mkdir <botname>
cd <botname>
rasa init
For a bot that repeats whatever a user says we don't need any NLP. But this will help us few concepts.
But before moving on let's do this without any NLP.
cd echo_bot/
python bot_without_nlp.py
Again, a search bot does not need much of NLP. But this example is just to explain how chatbots make an API call to fetch you data.
cd search_bot/
python bot_without_nlp.py
- Train the bot
cd wordbot
rasa train
- Run the command line UI
rasa shell
- Run the actions server
rasa run actions