-
Notifications
You must be signed in to change notification settings - Fork 3
/
extract_alignments.sh
31 lines (27 loc) · 1.3 KB
/
extract_alignments.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
train_file=$1
echo $train_file
train_path=$(dirname $train_file)/alignments/
echo $train_path
mkdir -p $train_path
python utils/summarize_aligned_data3.py $train_file ${train_path}/simple.align
python utils/pmi_align.py $train_file ${train_path}/pmi.align
for flag in "-d" "-o" "-v" "-d -o" "-d -v" "-o -v" "-d -o -v" ""; do
str_flag="${flag// /}"
str_flag="${str_flag//-/}"
fast_align -i $train_file $flag > ${train_path}/forward.align.${str_flag}
python utils/summarize_aligned_data.py $train_file ${train_path}/forward.align.${str_flag}
done
for flag in "-d" "-o" "-v" "-d -o" "-d -v" "-o -v" "-d -o -v" ""; do
str_flag="${flag// /}"
str_flag="${str_flag//-/}"
fast_align -i $train_file -r $flag > ${train_path}/reverse.align.${str_flag}
python utils/summarize_aligned_data.py $train_file ${train_path}/reverse.align.${str_flag}
done
for diag in "grow-diag-final-and" "grow-diag-final" "intersect" "grow-diag"; do
for flag in "-d" "-o" "-v" "-d -o" "-d -v" "-o -v" "-d -o -v" ""; do
str_flag="${flag// /}"
str_flag="${str_flag//-/}"
atools -i ${train_path}/forward.align.${str_flag} -j ${train_path}/reverse.align.${str_flag} -c ${diag} > ${train_path}/${diag}.align.${str_flag}
python utils/summarize_aligned_data.py $train_file ${train_path}/${diag}.align.${str_flag}
done
done