This is the official repository of our ACL'23 paper Triplet-Free Knowledge-Guided Response Generation. It only contains training and evaluating codes of our English models. If you are looking for our multimodal IceKC dataset, please check it out at here.
Install the following packages
pytorch
torchvision
transformers
Pillow
pandas
mlflow
py-rouge
mlflow
is optional for logging training process. If you do not want to install it, please refer to the training script on how to disable mlflow in training.
And install nlgeval
pip install git+https://github.com/Maluuba/nlg-eval.git@master
Note that to calculate ROUGE score, please install java. For more information, please refer to this link.
We have exported our environment into requirements.txt
. You may use
conda create --name <env> --file requirements.txt
to prepare the working environment.
Please refer to data for the training and testing data.
Use our training script to train models on WoW:
bash train_doc_eng.sh
Note that we use mlflow
and tensorboard
to log the training process in the provided script. To disable mlflow
logging, remove the --mlflow
argument in the training script. To disable tensorboard
, remove --tensorboard
.
If you are using mlflow
, you need to first start a mlflow server so that metrics and parameters can be logged. Use the following command to start the mlflow server:
mlflow server --backend-store-uri sqlite:///mlrunsdb15.db --default-artifact-root mlruns
You need to keep the server running during the whole training process.
Use our testing script to test models on WoW and WizInt datasets.
First, download our trained checkpoint from Google Drive or choose one of your saved checkpoints.
Then set the path to the checkpoint in test.sh
(line 2) and run
bash test.sh
If you find this work useful, please cite us with
@inproceedings{li2023triplet,
title={Triplet-Free Knowledge-Guided Response Generation},
author={Li, Dongming and Liu, Jianfeng and Wang, Baoyuan},
booktitle={Findings of the Association for Computational Linguistics: ACL 2023},
pages={12881--12899},
year={2023}
}