-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall_tools.sh
63 lines (53 loc) · 1.41 KB
/
install_tools.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
59
60
61
62
63
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
set -e
# data path
MAIN_PATH=$PWD
TOOLS_PATH=$PWD/tools
# tools
MOSES_DIR=$TOOLS_PATH/mosesdecoder
FASTBPE_DIR=$TOOLS_PATH/fastBPE
FASTBPE=$FASTBPE_DIR/fast
# tools path
mkdir -p $TOOLS_PATH
#
# Download and install tools
#
cd $TOOLS_PATH
# Download Moses
if [ ! -d "$MOSES_DIR" ]; then
echo "Cloning Moses from GitHub repository..."
git clone https://github.com/moses-smt/mosesdecoder.git
# use this to avoid permission denied when executing a mosesdecoder script
chmod -R 757 $MOSES_DIR
fi
# Download WikiExtractor
if [ ! -d $TOOLS_PATH/wikiextractor ]; then
echo "Cloning WikiExtractor from GitHub repository..."
git clone https://github.com/attardi/wikiextractor.git
fi
# Download FastText
if [ ! -d $TOOLS_PATH/fastText ]; then
#git clone https://github.com/facebookresearch/fastText.git
#cd fastText
#mkdir build && cd build && cmake ..
#make && make install
wget https://github.com/facebookresearch/fastText/archive/v0.9.2.zip
unzip v0.9.2.zip && rm v0.9.2.zip
cd fastText-0.9.2
make
cd ..
fi
# Download FastAlign
if [ ! -d $TOOLS_PATH/fast_align ]; then
git clone https://github.com/clab/fast_align.git
cd fast_align
mkdir build
cd build
cmake ..
make
fi