This repository contains the implementation of the Knowledge-Infused Topic Model (KITM) for generating empathetic dialogue responses using topic modeling enhanced with commonsense knowledge.
📄 Accepted to APSIPA ASC 2025 (Proceedings Paper)
Install all required packages via:
conda install --yes --file requirements.txt-
Download GloVe embeddings Download the GloVe.6B embeddings and place them in:
/vectors -
Dataset preprocessing
-
A preprocessed dataset (
dataset_preproc.p) is already included under:/data/ED/dataset_preproc.p -
If you would like to regenerate the dataset or modify knowledge types from COMET:
-
Delete
dataset_preproc.p -
Download the COMET-ATOMIC-2020 checkpoint
-
Place it under:
/data/ED/Comet
-
-
The dataset will be automatically reprocessed during training.
-
Note: We use BART-COMET because the GPT-2 COMET checkpoint is incompatible with this workflow.
-
This work uses two dialogue datasets, with the default configuration set to EmpatheticDialogues.
data
|--- ED
| |--- Comet/ # COMET model for commonsense inference
| |--- emp.pkl # Topic appearance probabilities
| |--- train.csv
| |--- valid.csv
| |--- test.csv
|
|--- DD
|--- Comet/
|--- dd.pkl # Topic appearance probabilities
|--- train.csv
|--- valid.csv
|--- test.csv
Files and COMET knowledge used for EmpatheticDialogues.
Files and COMET knowledge used for DailyDialog.
Run training with:
python main.py --cuda --save_path save/your_dirpython main.py --cuda --test \
--save_path save/your_dir \
--model_path save/dir_save/KITM_XXXX.XXXIf you have questions or are interested in collaboration, feel free to contact:
Just let me know!
