- 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_dir
can be set as./data/SARC_politics
,./data/Ghosh
, and./data/Ptacek
--model_select
can be set asKL-Bert
,Bert_concat
, andBert-Base
--output_dir
should keep up withdata_dir
andmodel_select
to be./output/DATASETNAME_MODELNAME_output/
--know_strategy
is for different knowledge selecting strategies, which can becommon_know.txt
,major_sent_know.txt
, andminor_sent_know.txt
--know_num
is 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