Home

Awesome

LMEDR <img src="https://pytorch.org/assets/images/logo-dark.svg" width = "90" />

Code for AAAI 2023 paper: Learning to Memorize Entailment and Discourse Relations for Persona-Consistent Dialogues.

Requirements

Check the package requirements

Please install ParlAI, which can be done in the following ways

git clone https://github.com/Chenrj233/ParlAI.git
cd ParlAI
python setup.py install

Please replace eval_f1.py and eval_hits.py in /ParlAI/projects/convai2/ with the corresponding files in /other/. Similarly, replace the generation_utils.py in transformers/ with the corresponding files in /other/, the file is in a path similar to

| -- python3.8
	| -- site-packages
		| -- transformers
			| -- modeling_utils.py
			| -- generation_utils.py
			| -- ...

Data

The datasets used in the paper can be obtained from the following link:

DatasetPaper
ConvAI2 PersonaChatThe Second Conversational Intelligence Challenge (ConvAI2)
DSTC7-AVSDAudio Visual Scene-aware dialog (AVSD) Track for Natural Language Generation in DSTC7
MNLI A broad-coverage challenge corpus for sentence understanding through inference
DNLIDialogue Natural Language Inference

Training

python train_PersonaChat.py --lr 8e-6 \
--epochs 20 \
--train_batch_size 2 \
--valid_batch_size 2 \
--infer_batch_size 64 
python train_dstc.py --lr 8e-6 \
--epochs 20 \
--train_batch_size 2 \
--valid_batch_size 2 \
--infer_batch_size 10

Evaluation

python evaluation_PersonaChat.py --model_checkpoint persona_original \
--eval_type hits@1
python evaluation_PersonaChat.py --model_checkpoint persona_original \
--eval_type f1 \
--beam 2 \
--max_history 7
python train_PersonaChat.py --load_from persona_original \
--eval
python dstc_generate.py --load_from dstc_model \
--beam 5

Results

We also provide the final generated texts, which can be found in /results/.