run_msra_ner.sh 1.4 KB
Newer Older
T
tianxin04 已提交
1 2
set -eux

T
tianxin 已提交
3
export FLAGS_eager_delete_tensor_gb=0
T
tianxin04 已提交
4
export FLAGS_sync_nccl_allreduce=1
C
chenxuyi 已提交
5
export CUDA_VISIBLE_DEVICES=0
T
tianxin04 已提交
6

C
chenxuyi 已提交
7 8
export PYTHONPATH=./ernie:${PYTHONPATH:-}
python -u ./ernie/run_sequence_labeling.py \
T
tianxin04 已提交
9 10 11 12 13
                   --use_cuda true \
                   --do_train true \
                   --do_val true \
                   --do_test true \
                   --batch_size 16 \
T
tianxin04 已提交
14
                   --init_pretraining_params ${MODEL_PATH}/params \
T
tianxin04 已提交
15
                   --num_labels 7 \
16
                   --chunk_scheme "IOB" \
T
tianxin04 已提交
17
                   --label_map_config ${TASK_DATA_PATH}/msra_ner/label_map.json \
T
tianxin04 已提交
18
                   --train_set ${TASK_DATA_PATH}/msra_ner/train.tsv \
C
chenxuyi 已提交
19
   		   --dev_set ${TASK_DATA_PATH}/msra_ner/dev.tsv,${TASK_DATA_PATH}/msra_ner/test.tsv \
T
tianxin04 已提交
20
                   --test_set ${TASK_DATA_PATH}/msra_ner/test.tsv \
T
tianxin 已提交
21 22
                   --vocab_path ${MODEL_PATH}/vocab.txt \
                   --ernie_config_path ${MODEL_PATH}/ernie_config.json \
T
tianxin04 已提交
23 24 25 26 27
                   --checkpoints ./checkpoints \
                   --save_steps 100000 \
                   --weight_decay  0.01 \
                   --warmup_proportion 0.0 \
                   --validation_steps 100 \
C
chenxuyi 已提交
28
                   --use_fp16 false \
T
tianxin 已提交
29
                   --epoch 6 \
T
tianxin04 已提交
30 31 32 33 34
                   --max_seq_len 256 \
                   --learning_rate 5e-5 \
                   --skip_steps 10 \
                   --num_iteration_per_drop_scope 1 \
                   --random_seed 1