-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdo_everything.sh
executable file
·58 lines (42 loc) · 1005 Bytes
/
do_everything.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
58
#!/bin/bash
# Builds corpus from bilingual files
# Builds a Moses model from the corpus
pushd .
. variables.sh
# 0. Prepare folders for downloading data
echo "Creating data folder"
mkdir $datadir
# 1. Download data from server or copy from file system
if $useserver; then
for i in "${servpaths[@]}"
do
echo "Download from $i:"
scp -r $server:$i/* $locpath/$datadir
done
else for i in "${srcpaths[@]}"
do
echo "Copying from $i..."
cp -r $i/* $locpath/$datadir
done
fi
# 2. Segment data
if $posegment ; then
posegment $datadir $segmentdir
datadir=$segmentdir
fi
# 3. Write pocounts for data
if $pocount ; then
echo 'Performing pocount'
pocount $datadir | tail -n 9 > pocount
fi
# 4. Convert data to Moses format
if $mosesconvert; then
mkdir $mosesdir
echo 'Converting files to moses format...'
python units_to_moses.py -c -n $corpusname -o $mosesdir $langtag1 $langtag2 $(find $datadir -type f)
fi
# 5. Build a Moses model
if $buildmodel; then
sh build_model.sh
fi
popd