First check whether your system meets the prereq
- Python 3.6
- Tensorflow 1.10.0
For Non Conda users please create a environment, with python 3.6 64bit version, having tensorflow version of 1.10.0. As because rasa nlu and rasa core supports, these specific version. Opting for other than these version will have an error with inbuilt packages which will be hard to be sorted out.
After creating a special environment as prescribed above or, installing from the system, then install the rasa versions
Now we have to install RASA first, follow the below link to install
https://rasa.com/docs/nlu/0.13.8/installation/
In command line:
pip install rasa_nlu
pip install rasa_nlu[tensorflow]
pip install rasa_core
Best to start with these versions of RASA NLU and RASA CORE
RASA NLU 0.13.8
RASA CORE 0.12.3
Any versions greater than this will be supported.
python -c "import rasa_nlu; print(rasa_nlu.__version__);"
python -c "import rasa_core; print(rasa_core.__version__);"
pip install “rasa_nlu==0.13.8”
pip install “rasa_core==0.12.3”
https://github.com/RasaHQ/starter-pack-rasa-stack Starter pack provides project file directory, including files to be added. Creating input examples for RASA NLU, with an app, to use that, first install
npm i -g rasa-nlu-trainer
Then launch it by moving to the data file directory and type,
rasa-nlu-trainer
After giving input examples via rasa-nlu-trainer check for the data.json file, if we want to add lookup table, synonyms examples add it and save it. Whatever we have given in the nlu trainer, it will get stored under the common examples of rasa_nlu_examples key.
Then we have to make ready the config file by choosing the right pipeline regarding to our problem. After the data.json and config.yml file is prepared, we can train the rasa nlu model by running a python script file. We are importing modules related to the train
File Required to run the RASA NLU for training and testing is “nlu_model.py”. Its available in the main source file directory. Create stories required or depending upon your business model and store it in the stories.md file as in the format provided. Create your domain file depending upon your business and store it as .yml file. Please follow the format as given in the example file “weatherdomain.yml”
File required to run the RASA CORE for training and testing is “train_init.py”. Its available in the main source file directory
To know more about the Embedding policy, take a look at https://arxiv.org/pdf/1811.11707.pdf
To Run your chatbot
- Start the actions file
- Move to your project directory and type as
python -m rasa_core_sdk.endpoint --actions actions
- Then run the rasa core
python -m rasa_core.run --enable_api -d \ models/dialogue_embedded_full_last_28_04_00pm -u \ models/nlu/default/dream_chatbot_nlu_28_02_2019_3pm --credentials credentials.yml \ --endpoint endpoints.yml
Give your model name of rasa core and your model name of rasa nlu, which you would have already trained in the above comand line and run the above command in the command prompt, in your project directory.
To connect with messaging platforms:
ngrok http 5005
Or to just run your chatbot in the command prompt and check Start the actions file as stated above Then run the chatbot as given the “train_init.py” file