-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLSTM.sh
66 lines (53 loc) · 2.16 KB
/
LSTM.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
domains=('service' 'rest' 'laptop' 'device')
export CUDA_VISIBLE_DEVICES=0
for src_domain in ${domains[@]};
do
for tar_domain in ${domains[@]};
do
if [ $src_domain != $tar_domain ];
then
if [ $src_domain == 'laptop' -a $tar_domain == 'device' ];
then
continue
fi
if [ $src_domain == 'device' -a $tar_domain == 'laptop' ];
then
continue
fi
############# LSTM ##############
#################################
python ./LSTM_based/cross_domain_LM/process_data.py \
--source_domain ${src_domain} \
--target_domain ${tar_domain} \
--in_path ./pseudo_outputs/ \
--out_path ./LSTM_based/process_data/
python ./LSTM_based/cross_domain_LM/train.py \
--input_file ./LSTM_based/process_data/${src_domain}-${tar_domain}/final_train.txt \
--output_dir ./LSTM_based/models/ \
--domain_pair ${src_domain}-${tar_domain}
python ./LSTM_based/cross_domain_LM/generate.py \
--target ${tar_domain} \
--source ${src_domain} \
--generate_number 10000
python absa/filter.py --task absa \
--domain_pair ${src_domain}-${tar_domain} \
--model_name_or_path /root/data2/bert-cross/ \
--do_filter \
--output_dir ./LSTM_based/generated_data/
python absa/main.py --task absa \
--domain_pair ${src_domain}-${tar_domain} \
--model_name_or_path /root/data2/bert-cross/ \
--data_path ./LSTM_based/generated_data/${src_domain}-${tar_domain}/filter.txt \
--output_dir ./LSTM_based/main_outputs/ \
--n_gpu 0 \
--do_train \
--do_eval \
--train_batch_size 16 \
--eval_batch_size 16 \
--learning_rate 3e-5 \
--num_train_epochs 5 \
--seed 62
fi
done
done