Deployment Manual

Prerequisites

NOTE: As we are using Rasa Open Source for our chatbot, support for Apple M1 Mac is currently lacking. It will be available once developers of Rasa release a supported version for M1 Mac.

Build and Run

Dependencies

  1. Clone the project to your local device
    • git clone https://github.com/juliagsy/ucl-infosys-team2-chatbot.git

  2. Install Python's Virtual Environment
    • pip3 install virtualenv

  3. Create a virtual environment
    • virtualenv venv --python=python3.8

  4. Activate the virtual environment
    • source venv/bin/activate

NOTE: When ending your session, run `deactivate` in the terminal to exit the virtual environment.

  1. Install the required dependencies
    • python3 -m pip install -r requirements.txt

Activating the Bot

NOTE: Activate virtual environment in all terminals.

  1. From this repository's directory, go into the 'chatbot' directory in 3 different terminals.
    • cd chatbot

  2. In one of the terminal, start the Rasa Action Server. (This is for backend algorithms.)
    • rasa run actions
Rasa Actions Server - Ready Status
  1. When the Rasa Action Server is up and running, start the Rasa Open Source Server in another terminal. (This is for HTTP communication.)
    • rasa run --enable-api --cors="*"
Rasa NLU Server - Ready Status
  1. When the Rasa Open Source Server is up and running, start your localhost server.
    • python3 -m http.server
Python3 HTTP Server - Ready Status
  1. In another new terminal, go into the 'database' directory.
    • cd database

  2. Migrate and activate the database server.
    • python3 manage.py migrate
    • python3 manage.py runserver 3000
Database Server - Ready Status
  1. Start using the bot in `localhost:8000`.

NOTE: As the model is built on natural-language understanding (NLU), the use of certain keywords such as "values", "levels", "which", "what" or "how" could affect the answers by their respective definitions.

  1. Sample reports are available in `chatbot/sample-reports` for trying out the bot.

Testing

The steps to run the tests are shown below. More information about test results could be found in the Testing Section of the project website.

TaPas Auxiliary Function Unit Test

  1. Activate the virtual environment
    • source venv/bin/activate

  2. Go into the 'chatbot/tapas/tests' directory
    • cd chatbot/tapas/tests

  3. Run the tests
    • pytest

Django Database Unit Test

  1. Activate the virtual environment
    • source venv/bin/activate

  2. Go into the 'database' directory
    • cd database

  3. Run the tests
    • python3 manage.py test

Bot Integration Test

  1. Activate the virtual environment
    • source venv/bin/activate

  2. Go into the 'chatbot' directory
    • cd chatbot

  3. Run the tests
    • rasa test