- PyTorch
- Transformers
The script for training is:
PYTHONENCODING=utf-8 python run_classifier.py --data_dir ./data/Ptacek \
--output_dir ./output/Ptacek_KL-Bert_output/ --do_train --do_test --model_select KL-Bert
where
--data_dircan be set as./data/SARC_politics,./data/Ghosh, and./data/Ptacek--model_selectcan be set asKL-Bert,Bert_concat, andBert-Base--output_dirshould keep up withdata_dirandmodel_selectto be./output/DATASETNAME_MODELNAME_output/--know_strategyis for different knowledge selecting strategies, which can becommon_know.txt,major_sent_know.txt, andminor_sent_know.txt--know_numis to choose how many items of knowledge are used for each sentence, which is set to'5','4','3','2','1'
The script for testing is:
PYTHONENCODING=utf-8 python run_classifier.py --data_dir ./data/Ptacek \
--output_dir ./output/Ptacek_KL-Bert_output/ --do_test --model_select KL-Bert