-
Notifications
You must be signed in to change notification settings - Fork 5
Install from source code
Ali Razmdideh edited this page Aug 8, 2021
·
15 revisions
git clone https://github.com/arezae/chatbot --branch rasa --single-branch --depth 1
To run the Rasa chatbot, we need to run actions-server and chatbot-server separately. So we've separated actions, datasets, and the chatbot from each other.
Action-Server will contain actions and datasets, and Rasa-Server will contain the chatbot model and its autocorrect component.
production/
├── action-server
│ ├── actions
│ └── docker
├── mysql-server
└── rasa-server
├── autocorrect
│ └── data
├── docker
└── rasa
├── data
└── tests
In the rest of the document, we will install requirements and then run chatbot and action servers.
pip install --user --upgrade pip
pip install --user virtualenv
python -m venv rasa_env
source virtualenv/bin/activate
pip install --no-cache-dir -r production/rasa-server/requirements.txt
pip install --no-cache-dir -r production/rasa-server/requirements.txt -r production/action-server/requirements.txt
python -m spacy download en_core_web_md
Download the autocorrect module dictionaries. This dictionary consists of English and medical words.
cd production/rasa-server
python -c "import autocorrect; autocorrect.Speller('en_med')"
cd production/rasa-server/rasa
rasa train
You can also download model weights from Dropbox.
We are almost done. Now we can run the rasa and actions server.
- Run the Rasa server. If you would like to run the Rasa server with tokens to authenticate requests, You can add
--auth-token YOUR_TOKENat the end of the following command
cd production/rasa-server/rasa
mkdir logs
rasa run --log-file logs/rasa-server.log --enable-api
-
Restoring database from dump files
mysql -uroot -p"$MYSQL_ROOT_PASSWORD" datasets < mysql-server/datasets.sql
- Create logs directory
cd production/action-server/actions
mkdir logs
- Create .env file into
action-serverdirectory, to read database information:
$ cat action-server/.env
MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
SQL_USER=root
HOST=db
MYSQL_DATABASE=datasets
DRUG_TABLE=drugs
LAB_TABLE=labs
- Run action server
rasa run --log-file logs/action-server.log actions --actions actions
curl --location --request POST 'http://localhost:5005/webhooks/rest/webhook' \
--header 'Content-Type: application/json' \
--data-raw '{
"message" : "Can you give me dosage information of Abilify?",
"sender" : "default"
}'