Presentation on chatbot created using RASA NLU and RASA CORE with slack as its communication platform. This is Artificial Intelligence usage in Drupal. We have covered this topic in an online event "Drupal and Artificial Intelligence for Personalization" on May 18th
2. INTRODUCTION
● This is a chatbot created using RASA NLU and
RASA CORE with slack as its communication
platform.
● Rasa NLU will understand the natural language.
● Rasa core will maintain the dialogue flow.
3. REQUIREMENTS
To run this application below are the requirements:
a. Anaconda3 or Virtualenv
a. npm and node
4. INSTALLATION
Install anaconda3 or virtualenv
a. Follow the below link to setup anaconda
https://www.digitalocean.com/community/tutorials/how-to-install-the-anaconda-
python-distribution-on-ubuntu-16-04
Install node and npm
a. Follow the below link to setup node and npm
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-
16-04
5. INSTALLATION
Create Environment
source activate venv
Setting up
Get the project repo and do the following operation for setup
➔ git clone https://path/to/repository/rasa-bot.git
➔ cd rasa_app
➔ pip install -r requirements.txt
➔ python -m spacy download en
➔ npm i -g rasa-nlu-trainer
6. CONNECTION/CLIEN
T
Here we are using slack as a communication channel. So to work with slack we
have to do the following.
Create your own slack workspace or use existing one if you have the permission to
integrate third party app.
Get the legacy token which you will be using on your app to communicate.
Workspace: [yourworkspace].slack.com
● Username: yourusername
● Password: yourpassword
Tokens: https://api.slack.com/custom-integrations/legacy-tokens
9. INSTANCES
NLU Training MODEL
Every model we have to train manually with some dummy data. The more the
sample data the more will be the accuracy label. Below is the step to train a model.
➔ Open nlu_model.py
➔ Uncomment train_nlu('./data/data.json…….. In last if statement
➔ Comment run_nlu()
➔ Run python nlu_model.py
10. INSTANCES
NLU trainer UI
This application contains a rasa nlu trainer which will give you to add/edit the
sample data using a UI.
Where you can add statement or select entity or intent.
➔ Run rasa-nlu-trainer
11. INSTANCES
Rasa Core
This is used to control the dialogue flow and manage the session data.
Find which RASA NLU Version you are running
python -c "import rasa_nlu; print(rasa_nlu.__version__);"
Output: 0.11.3
Ref: https://nlu.rasa.ai/ Language Understanding with rasa NLU
12. INSTANCES
Find Which Node Package Manager you are using
npm -v
Output: 5.6.0
Find Which Node you are using
node -v
Output: v9.8.0