SlowGuess/NAACL_2022_OCR huggingface dataset:
Our model is implemented by Pytorch  $^{10}$ , and based on two encoders of BART-base and a decoder of BART-base  $^{11}$ . Hidden size  $d$  is 768 and the number of emotion classes  $n_{emo}$  is 32.  $MH$  and the number of layers of graph attention network are each 4. Using Adam optimization (Kingma and Ba, 2015), our model is trained on single RTX 3090 GPU with a batch size of 4. We apply early-stopping and select a model showing the best performance through perplexity on the valid set. For contrastive PPLM, we utilize the official code of PPLM  $^{12}$ . We set a temperature parameter  $\tau$  and batch size to 0.5 and 64, respectively. Through representations derived from the last token of BART decoder whose parameters are frozen, we can obtain each response representation  $r_a$  and each keyword set representation  $ks_a$ , where the keyword set corresponds to the response. Thus,  $ks_a$  becomes a positive sample for  $r_a$ , and keyword set representations for other responses in the same batch become negative samples.
A.2 Next Emotion and Keywords Detection
We utilize the repositories and follow implementation details of CoMAE  $^{13}$ , ConceptFlow  $^{14}$ , and CG-nAR  $^{15}$ . We train three models, using EmpatheticDialogues instead of originally used datasets.
10https://pytorch.org/ 11https://huggingface.co/docs/   
transformers/model_doc/bart 12https://github.com/uber-research/PPLM 13https://github.com/chujiezheng/CoMAE 14https://github.com/thunlp/ConceptFlow 15https://github.com/RowitZou/CG-nAR