NUS IS5452 Project
Folders:
- EmotionRecognition: Code of emotion recognition model
- Generation: Code of GPT-2 text generation model
- GUI: Code to create graphical user interface
- Serving: Code to start the emotion recognition model service (avoid tensorflow conflicts when the GPT-2 model)
Demo:
- LittleGenius_Demo.mp4: Shows how this application works
Clone this repo to a desired local location.
pip install -r requirements.txt
Attention:
The package dataclasses is necessary for this program, and dataclasses is inclueded in Python3.7 and later versions.
If you use Pyhton3.6, please go to https://pypi.org/project/dataclasses/ or use pip install dataclasses==0.8
to manually download the package. Pyhton version earlier than 3.6 is not recommended for this program.
-
Download the fine-tuned GPT-2 model from google drive sharing link.
The file is 884.3MB, including two models:
level1000: Fine-tuned for 1000 steps with Q&A sentences from professional mental consultation platform (more stick to depression-related expressions)
level400: Fine-tuned for 400 steps with Q&A sentences from professional mental consultation platform (more general)
The default model used is level400. It is defined by line 46 in file GUI/ChatbotPage.py.
self.model_name = "level400"
To choose model level1000, change this line to
self.model_name = "level1000"
-
GPT-2 model file structure
After downloading the fine-tuned GPT-2 model, unzip the file and put the folder "checkpoint" to the path "./Emotion-based-Chatbot/Generation/checkpoint".
The program structure should look like this:
- init model serving
cd Serving
python serving_ER.py
- run app
cd ../GUI
python APP.py