The humour detection model code be found in HaHA/humour_detection_model/, but this is only provided for reference and will not be needed to run the bot as the humour scores have been pre-computed.
-
Before running the code in this folder, please obtain the model for emotion classification from https://drive.google.com/drive/folders/19uh2aIyxqzS-4LiagBouu6YuPYiOvaDz?usp=sharing
-
You may need to change the file paths in 'classifiers.py' and 'rule_based_model.py' to your local paths when running locally
-
This chatbot uses the react-chatbot-kit library: https://fredrikoseberg.github.io/react-chatbot-kit-docs/
To run the code in this folder locally, after cloning open a terminal window and do (from the directory where you cloned this project):
$ pip3 install virtualenv
$ virtualenv ./HaHA (if this doesn't work, try python3 -m virtualenv)
$ cd ./HaHA
$ source bin/activate
$ cd ./model
$ python3 -m pip install -r requirements.txt
$ set FLASK_APP=flask_backend_with_aws
$ flask db init
$ flask db migrate -m "testDB table"
$ flask db upgrade
$ nano .env ----> add DATABASE_URL="sqlite:////YOUR LOCAL PATH TO THE app.db FILE" to the .env file, save and exit
$ flask run
$ cd ./HaHA/view
$ npm i
$ npm run start
Once set up, you can run the chatbot by simply executing the following commands in seperate tabs from the run_project directory:
$ ./run_HaHA_backend.bash
$ ./run_HaHA_frontend.bash