In this project, we construct a dialogue system based on the project datasets. The system implement the two options provided in the project requirements:
- A chatbot based on the BART model which is trained by our group.
- A chatbot based on a pre-trained large language model.
The system structure can be divided into three parts:
- A web interface to showcase our system.
- Two chatbots and a http server to provide the dialogue service.
- A BART model finetune and inference framework to show how we train and use the model.
- A Qwen-max llm model with local knowledege as a baseline model to compare.
According to the requirements, the model weight files belong to the large files, it is stored in the Google Drive. You should download the three files listed below and put them into the /model
path in the source code directory.
The required packages are listed in requirements.txt
. You can find the file in the source code directory. Suppose you use Anaconda to manage the Python dependencies, you can install them by running:
conda create -n chatbot python=3.9.7
conda activate chatbot
pip install -r requirements.txt
The Dialogue system consists of two parts: chatbot service and web interface.
- The chatbot service is provided using http server.
python httpserver.py
- Web Interface
The system provide a static html web interface, find the html file under the path
/UI
in the source code directory. Open it using the browser (Chrome is highly recomended here).
python -u main.py --mode train
Or
sh finetune.sh
Note that the output trained model weight files will be saved in the path /model
.
python -u main.py --mode inference --load_model --model_path ./model/
Or
sh inference.sh
Load model from /model
and get result.txt in /data