To set up project go through the following stepd:
- Extract Features by using RoBERTa and COMET. Due to complicated steps to run RoBERTa and COMET you can download the result of step 1-6 from here
- You can follow step 1-3 or using tutorial of here
- Preprocess the data: Data should be preprocessed following the language modeling format and use GPT-2 BPE (Byte Pair Encoding) tokenizer. conv-emotion\COSMIC\feature-extraction\roberta_preprocess_iemocap.sh
- Train RoBERTa base: conv-emotion\COSMIC\feature-extraction\roberta_preprocess_iemocap.sh conv-emotion\COSMIC\feature-extraction\roberta_train_iemocap.sh
- Load your pretrained model: conv-emotion\COSMIC\feature-extraction\roberta_feature_extract_iemocap.py
- Clone COMET project from here
- Download pretrained atomic model from here to extract common-sense features.
- Keep the result of prior step in train/erc-training
- To run the project, install prerequisites
- python 3.8.8
- torch 1.8.1
- scikit-learn 0.24.1
- plotly 4.14.3
- pandas 1.2.3
- numpy 1.19.5
- notebook 6.3.0
- ipython 7.21.0
- tqdm 4.63.0
- Training, validation, testing, and evaluation of each dataset, have be done by the followin steps:
- python train_iemocap.py
- python train_meld.py
- python train_dailydialog.py
- python train_emorynlp.py
- You can change the default value of hyperparameter and argument. There are different hyperparameters and argumens you can change by the following stepa:
- no-cuda: Run model on GPU or CPU
- lr: Learning rate
- l2: L2 regularization weight
- recurrent_dropout: recurrent_dropout of GRU
- dropout: Dropout rate for hidden layer
- batch-size
- epochs
- class-weight: Use class weight form imbalanced dataset
- active-listener: This is Monologue and Dialogue
- attention: Attention type in context GRU
- seed
- norm: normalization strategy
- You can pass the value to each dataset like this: python train_iemocap.py --no-cuda --epochs=50 --class-weight --active-listener
- The result will be saved in train/logs