-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.sh
executable file
·50 lines (40 loc) · 1.42 KB
/
setup.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
#/bin/bash
# Fail if we reference any unbound environment variables.
set -u
# Check if external data needs to be downloaded.
resource_url=lil.cs.washington.edu/resources
data_dir=neuralccg/data
if [ ! -e $data_dir ]
then
echo "Downloading data from $resource_url"
mkdir $data_dir
# Turian et al. (2010) 50-dimensional word embeddings.
curl -o $data_dir/embeddings.raw $resource_url/embeddings.raw
# Lewis et al. (2016) supertagging model.
supertagger=model_tritrain_finetune_long.tgz
curl -o $supertagger $resource_url/$supertagger
tar -xzvf $supertagger -C $data_dir
rm $supertagger
# Lee et al. (2016) parsing model.
curl -o $data_dir/llz2016.model.pb $resource_url/llz2016.model.pb
else
echo "Using cached data from $data_dir"
fi
lib_dir=neuralccg/lib
if [ ! -e $lib_dir ]
then
echo "Downloading binaries from $resource_url"
mkdir $lib_dir
curl -o $lib_dir/libtaggerflow.so $resource_url/libtaggerflow.so
curl -o $lib_dir/libtaggerflow.jnilib $resource_url/libtaggerflow.jnilib
else
echo "Using cached binaries from $lib_dir"
fi
rm -f jni/java_home
ln -sf $JAVA_HOME jni/java_home
# Build JNI binaries and move them to the appropriate location.
bazel build -c opt neuralccg:libdecoder.so
rm -f $lib_dir/libdecoder.so
cp bazel-bin/neuralccg/libdecoder.so $lib_dir/libdecoder.so
rm -f $lib_dir/libdecoder.jnilib
cp bazel-bin/neuralccg/libdecoder.so $lib_dir/libdecoder.jnilib