-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·292 lines (164 loc) · 5.35 KB
/
bootstrap.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
#!/bin/bash -e
COGCOMP_URL=http://cogcomp.cs.illinois.edu/software
START=$PWD
DIRNAME=`dirname "$0"`
CURATOR_BASE=`cd "$DIRNAME" > /dev/null && pwd`
LIBDIR=$CURATOR_BASE/lib
TMPDIR=$CURATOR_BASE/tmp
DIST=$CURATOR_BASE/dist
ANNOTATORDIR=$CURATOR_BASE/curator-annotators
echo "$0: setting environment variables..."
source setEnvVars.sh
echo "$0: About to download required libraries and data files..."
BASIC=1
NEW_NER=1
STANFORD=1
SRL=1
WIKIFIER=1
COREF=1
## NOT READY FOR RELEASE
#QUANTIFIER=0
CLEANUP=0
DWNLDCMD="curl -O"
NOCURL=1
if [ $NOCURL -ne 0 ]; then
DWNLDCMD="wget -N"
fi
mkdir -p $LIBDIR
mkdir -p $TMPDIR
cd $TMPDIR
#########
# BASIC #
#########
if [ $BASIC -eq 1 ]; then
echo "Downloading LBJ component dependencies..."
$DWNLDCMD $COGCOMP_URL/LBJ-2.8.2.jar
$DWNLDCMD $COGCOMP_URL/LBJLibrary-2.8.2.jar
$DWNLDCMD $COGCOMP_URL/LBJPOS.jar
$DWNLDCMD $COGCOMP_URL/LBJChunk.jar
$DWNLDCMD $COGCOMP_URL/tools/IllinoisLemmatizer.tgz
echo "Moving LBJ dependencies..."
mv LBJ-2.8.2.jar $LIBDIR/LBJ-2.8.2.jar
mv LBJLibrary-2.8.2.jar $LIBDIR/LBJLibrary-2.8.2.jar
mv LBJPOS.jar $LIBDIR
mv LBJChunk.jar $LIBDIR
tar xzf IllinoisLemmatizer.tgz
mv IllinoisLemmatizer/dist/* $LIBDIR
mv IllinoisLemmatizer/lib/* $LIBDIR
rm -rf $ANNOTATORDIR/illinois-lemmatizer/data
mv IllinoisLemmatizer/data $ANNOTATORDIR/illinois-lemmatizer/
# mv IllinoisLemmatizer/config/* $ANNOTATORDIR/illinois-lemmatizer/config/
fi
#######
# NER #
#######
NEREXT_DIR=$CURATOR_BASE/curator-annotators/illinois-ner-extended
NEREXT_CONFIG=$NEREXT_DIR/configs
#NEREXT_DATA=$NEREXT_DIR/data
NERSRC_DIR=illinois-ner-2.8.2
if [ $NEW_NER -eq 1 ]; then
echo "Downloading Illinois NER component dependencies..."
$DWNLDCMD $COGCOMP_URL/$NERSRC_DIR.tgz
echo "Unpacking NER dependencies..."
tar xzf $NERSRC_DIR.tgz
echo "Moving NER dependencies..."
mv $NERSRC_DIR/dist/illinois-ner-2.8.2.jar $LIBDIR/
mv $NERSRC_DIR/lib/* $LIBDIR
fi
###################
# stanford parser #
###################
STANFORDDATADIR=$CURATOR_BASE/curator-annotators/stanford-parser/data
if [ $STANFORD -eq 1 ]; then
echo "Downloading Stanford parser component dependencies..."
$DWNLDCMD $COGCOMP_URL/stanford_parser_backup.tgz
echo "Unpacking Stanford parser dependencies..."
tar xzf stanford_parser_backup.tgz
echo "Moving Stanford parser dependencies..."
mv stanford_backup/stanford-parser-2010-08-16.jar $LIBDIR
mkdir -p $STANFORDDATADIR
mv stanford_backup/englishPCFG.ser.gz $STANFORDDATADIR
fi
##############
# QUANTIFIER #
##############
# ******* Quantifier NOT READY for inclusion: build errors/missing classes ******* #
QUANTDIST=illinois-quantifier
if [ $QUANTIFIER -eq 1 ]; then
echo "Downloading Illinois Quantifier component dependencies..."
$DWNLDCMD $COGCOMP_URL/$QUANTDIST.zip
echo "Unpacking Quantifier dependencies..."
unzip $QUANTDIST.zip
echo "Moving Quantifier dependencies..."
mv $QUANTDIST/dist/* $LIBDIR
mv $QUANTDIST/lib/* $LIBDIR
fi
#######
# SRL #
#######
VERBCONFIG=$CURATOR_BASE/curator-annotators/illinois-verb-srl/configs
NOMCONFIG=$CURATOR_BASE/curator-annotators/illinois-nom-srl/configs
SRLDIST=illinoisSRL
SRLVERSION=4.1.1
if [ $SRL -eq 1 ]; then
echo "Downloading Illinois SRL component dependencies..."
$DWNLDCMD $COGCOMP_URL/$SRLDIST-$SRLVERSION.tgz
echo "Unpacking SRL dependencies..."
tar xzf $SRLDIST-$SRLVERSION.tgz
echo "Moving SRL dependencies..."
mv $SRLDIST-$SRLVERSION/dist/* $LIBDIR
mv $SRLDIST-$SRLVERSION/lib/* $LIBDIR
# mv $SRLDIST-$SRLVERSION/models/* $LIBDIR
fi
############
# wikifier #
############
WIKIDIST=illinois-wikifier-3.1
WIKIBASE=$CURATOR_BASE/curator-annotators/illinois-wikifier
WIKIFIERDATADIR=$CURATOR_BASE/curator-annotators/illinois-wikifier/data/wikifierData
if [ $WIKIFIER -eq 1 ]; then
echo "Downloading Illinois Wikifier component dependencies..."
$DWNLDCMD $COGCOMP_URL/$WIKIDIST.tgz
echo "Unpacking Wikifier dependencies..."
tar xzf $WIKIDIST.tgz
echo "Moving Wikifier dependencies..."
mv $WIKIDIST/dist/wikifier-3.1.jar $LIBDIR/illinois-wikifier-3.1.jar
mv $WIKIDIST/lib/* $LIBDIR
mkdir -p $WIKIFIERDATADIR
mv $WIKIDIST/data/* $WIKIFIERDATADIR
fi
#########
# COREF #
#########
VERSION=1.5.5-SNAPSHOT
COREF_ACE_DIR=$CURATOR_BASE/curator-annotators/illinois-coref-ace
COREF_ACE_CONFIG=$COREF_ACE_DIR/configs
COREF_ACE_SRC_DIR=illinois-coref-ace-$VERSION
COREF_ACE_SRC_DIST=$COREF_ACE_SRC_DIR
if [ $COREF -eq 1 ]; then
echo "Downloading Illinois Coreference (ACE) component dependencies..."
$DWNLDCMD $COGCOMP_URL/$COREF_ACE_SRC_DIST.tgz
echo "Unpacking Coref dependencies..."
tar xzf $COREF_ACE_SRC_DIST.tgz
echo "Moving Coref dependencies..."
mv $COREF_ACE_SRC_DIR/dist/* $LIBDIR
mv $COREF_ACE_SRC_DIR/lib/* $LIBDIR
fi
#########
# MONGO #
#########
echo "Downloading MongoDB Java driver..."
## NOTE CURL fails on this link due to SSL handshake error; looks like
## a server config error by the host (see
## https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/861137)
$DWNLDCMD $COGCOMP_URL/mongo-2.7.3.jar
mv mongo-2.7.3.jar $LIBDIR
#######
# END #
#######
if [ $CLEANUP -eq 1 ]; then
echo "Cleaning up"
cd $CURATOR_BASE
rm -rf $TMPDIR
fi
echo "$0: Done."