-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreprocess_data.sh
executable file
·53 lines (41 loc) · 1.23 KB
/
preprocess_data.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
#!/bin/bash
# To be run in the docker container
# Needs /raw-data, /wiki and /data mounted, with >365 GiB available in /data
DATA_DIR="/raw-data"
WIKI_DIR="/wiki"
OUTPUT_DIR="/data"
RANDOM_SEED=12345
pushd cleanup_scripts
echo "Generating TFRecords for training set"
for num in {001..500}
do
echo -e "Preprocessing part-00${num}"
python create_pretraining_data.py \
--input_file=${DATA_DIR}/part-00${num}-of-00500 \
--output_file=${OUTPUT_DIR}/part-00${num}-of-00500 \
--vocab_file=${WIKI_DIR}/vocab.txt \
--do_lower_case=True \
--max_seq_length=512 \
--max_predictions_per_seq=76 \
--masked_lm_prob=0.15 \
--random_seed=${RANDOM_SEED} \
--dupe_factor=10
done
echo "Generating TFRecords for eval set"
python create_pretraining_data.py \
--input_file=${DATA_DIR}/eval.txt \
--output_file=${DATA_DIR}/eval_intermediate \
--vocab_file=${WIKI_DIR}/vocab.txt \
--do_lower_case=True \
--max_seq_length=512 \
--max_predictions_per_seq=76 \
--masked_lm_prob=0.15 \
--random_seed=${RANDOM_SEED} \
--dupe_factor=10
python pick_eval_samples.py \
--input_tfrecord=${DATA_DIR}/eval_intermediate \
--output_tfrecord=${OUTPUT_DIR} \
--num_examples_to_pick=10000
popd
echo "All done!"
exit 0