-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaozora_cola.sh
executable file
·57 lines (54 loc) · 1.28 KB
/
aozora_cola.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
#!/bin/sh
export BERT_BASE_DIR=`pwd`/multilingual_L-12_H-768_A-12
export GLUE_DIR=`pwd`/aozora
export PYTHONPATH=`pwd`/bert
BIN_PYTHON=python
EPOCH=3
NO_CHKPT=0
while getopts e:p:ns opts ; do
case $opts in
e)
EPOCH=$OPTARG
OUTPUT_PATH=aozora/cola_${EPOCH}_output
;;
p)
BIN_PYTHON=$OPTARG
;;
n)
NO_CHKPT=1
;;
s)
export GLUE_DIR=`pwd`/aozora/small
OUTPUT_PATH=aozora/small/cola_${EPOCH}_output
;;
esac
done
if [ $NO_CHKPT -eq 0 ] ; then
$BIN_PYTHON bert/run_classifier.py \
--task_name=cola \
--do_train=true \
--do_eval=true \
--data_dir=$GLUE_DIR \
--vocab_file=$BERT_BASE_DIR/vocab.txt \
--bert_config_file=$BERT_BASE_DIR/bert_config.json \
--init_checkpoint=$BERT_BASE_DIR/bert_model.ckpt \
--max_seq_length=128 \
--train_batch_size=32 \
--learning_rate=2e-5 \
--num_train_epochs=$EPOCH \
--output_dir=$OUTPUT_PATH
else
OUTPUT_PATH=${OUTPUT_PATH}_nockpt
$BIN_PYTHON bert/run_classifier.py \
--task_name=cola \
--do_train=true \
--do_eval=true \
--data_dir=$GLUE_DIR \
--vocab_file=$BERT_BASE_DIR/vocab.txt \
--bert_config_file=$BERT_BASE_DIR/bert_config.json \
--max_seq_length=128 \
--train_batch_size=32 \
--learning_rate=2e-5 \
--num_train_epochs=$EPOCH \
--output_dir=$OUTPUT_PATH
fi