Getting started with RASA Chatbot — RASA Stack Starter Pack

Dikshit Kathuria
3 min readFeb 5, 2019

--

Thanks to the improvements,enhancements in the field of Artificial Intelligence. We now can do anything that a human brain is supposed to. From predicting objects in images to handling our client’s conversation using Bots, AI is everywhere.

This article is a brief introduction to How to setup RASA in your local machine to power your ChatBot.

Source: Google Images

The tutorials to install RASA and power a bot are easily available over the web but no tutorial explains the problems that are faced while installing RASA stack, its dependencies etc.

Prerequisites-

  1. Python (Any version less than 3.7.x because RASA uses Tensorflow which is under testing for version 3.7.x)

Steps :

  1. Clone the RASA stack starter pack which can be find here and unzip it in any folder.
  2. This starter pack contains a requirements.txt file. You need to perform the pip command in your command prompt and install all dependencies.
pip install -r requirements.txt

Possible errors here that you can fall into:

Microsoft Visual C++ 14.0 is required. Get it with “Microsoft Visual C++ Build Tools”: http://landinghub.visualst udio.com/visual-cpp-build-tools

The solutions to this :

a) Under Windows there are 3 choices only CHECK Desktop development with C++

b) Under Web & Cloud there are 7 choices only CHECK Python development (I believe this is optional But I have done it).

Under the “Individual Components” Tab, select the necessary dependencies as shown:

Required Dependencies

Cannot install Tensorflow

The solution to this:

Rasa_NLU uses tensorflow version 1.10.0 and Tensorflow only runs on 64 Bit installed Python

If you get an error about the same, you can:

python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.0-py3-none-any.whl

3. After installing the requirements, you have to install spacy by :

python -m spacy download en

You may run into error here regarding Tensorflow version but if you installed Tensorflow -1.10.0 , everything will work as expected.

Now after configuring all the requirements, it’s time to use RASA Stack

Steps:

  1. You can train the Rasa NLU model by running:
python -m rasa_nlu.train -c nlu_config.yml --data data/nlu_data.md -o models --fixed_model_name nlu --project current --verbose

2. You can train the RASA Core model by running:

python -m rasa_core.train -d domain.yml -s data/stories.md -o models/current/dialogue -c policies.yml

3. In a new terminal start the server for the custom action by running:

python -m rasa_core.run -d models/current/dialogue -u models/current/nlu --endpoints endpoints.yml

This will start the server for emulating the custom action.

4. You can test the Bot by running

python -m rasa_core_sdk.endpoint --actions actions

And Bam ! Your Bot is now ready to be tested. Play with it and perform the changes in the Intents in the nlu_data.md file. Retrain it and you’ve made your custom bot.

References :

  1. https://www.youtube.com/watch?v=lQZ_x0LRUbI
  2. https://github.com/RasaHQ/starter-pack-rasa-stack
  3. https://rasa.com/docs/

Dont forget to donate a clap if this blog helped you !

Happy Chatting.

--

--