The PyTorch code for paper: Knowledge-Enriched Transformer for Emotion Detection in Textual Conversations (PDF)
The model is largely based on The Annotated Transformer
- Download data: download data to respective foler in
./data/
:EC
,DD
,MELD
,EmoryNLP
, andIEMOCAP
. - Install Magnitude Medium GloVe for pretrained word embedding.
- Preprocess data: run
preprocess.py
to processcsv
orpkl
(IEMOCAP) files intopkl
data. - Download ConceptNet and NRC_VAD.
- Preprocess ConceptNet and NRC_VAD: run
preprocess_conceptnet.py
andpreprocess_NRC_VAD.py
. - Model training: run
train.py
. - Model evaluation: run
train.py
withtest_mode
set.
If you find this repo or paper useful, please cite
@inproceedings{zhong2019knowledge,
title = "Knowledge-Enriched Transformer for Emotion Detection in Textual Conversations",
author = "Zhong, Peixiang and Wang, Di and Miao, Chunyan",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)",
year = "2019",
publisher = "Association for Computational Linguistics",
pages = "165--176"
}