-
Notifications
You must be signed in to change notification settings - Fork 2
/
6-train_fusion_ner.sh
33 lines (29 loc) · 1.21 KB
/
6-train_fusion_ner.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
#!/bin/bash
TASK_NAME="fusion_ner"
LANGUAGES=("bg")
ADAPTER_CN_DIR="./lang_adapters/cn"
ADAPTER_WIKI_DIR="./lang_adapters/wiki"
pip install seqeval adapters
for LANGUAGE in "${LANGUAGES[@]}"; do
for i in {1..3}; do
OUTPUT_DIR="/netscratch/dgurgurov/inject_commonsense/fullwordmasking/$TASK_NAME/models/$LANGUAGE/$i"
ADAPTER_CN_CONFIG="./lang_adapters/cn/$LANGUAGE/adapter_config.json"
ADAPTER_WIKI_CONFIG="./lang_adapters/wiki/$LANGUAGE/adapter_config.json"
echo "Training iteration $i for language: $LANGUAGE"
python scripts/ner_fusion.py \
--output_dir $OUTPUT_DIR \
--model_name "bert-base-multilingual-cased" \
--adapter_cn_dir $ADAPTER_CN_DIR/$LANGUAGE \
--adapter_wiki_dir $ADAPTER_WIKI_DIR/$LANGUAGE \
--adapter_cn_config $ADAPTER_CN_CONFIG \
--adapter_wiki_config $ADAPTER_WIKI_CONFIG \
--learning_rate 2e-4 \
--num_train_epochs 100 \
--per_device_train_batch_size 64 \
--per_device_eval_batch_size 64 \
--evaluation_strategy "epoch" \
--save_strategy "epoch" \
--weight_decay 0.01 \
--language $LANGUAGE
done
done