-
Notifications
You must be signed in to change notification settings - Fork 4
/
run.sh
executable file
·316 lines (265 loc) · 10.8 KB
/
run.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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
## 7/14/18
## Amy Olex and Luke Maffey
## run.sh provides a one command option to running Chrono without having to remember the long command or data locations
##
## Edit the script to add in additional options as needed.
## I have one option for my laptop using the training data, and two options for willow, one with training and the other with test.
## I have not added in any evaluation options yet.
USER=$1 ##Options: amy, luke, help
LOC=$2 ##Options: willow, laptop
DATASET=$3 ##Options: test, train
ML=$4 ##Chrono options
ML_DATA=$5 ##Options: news5, news3, clin5, clin3, newsclin5, newsclin3
REL=$6 ##Options: rel, norel
## Example Usage: ./run.sh amy laptop train NB news5
## Below are the variables to change for each user if the data locations change
if [ $USER = "help" ]
then
echo "Usage: ./run.sh USER DEVICE DATASET ML ML_DATA"
echo "USER: amy, luke, help"
echo "LOC: willow, laptop"
echo "DATASET: train, test"
echo "ML: SVM, NB, DT, RB, NN"
echo "ML_DATA: news5, news3, clin5, clin3, newsclin5, newsclin3"
fi
if [ $USER = "amy" ]
then
if [ $LOC = "laptop" ]
then
ANAFORA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/anaforatools"
if [ $DATASET = "test" ]
then
DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/data/THYME"
OUT_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/results/Colon_dev"
ML_DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/sample_files"
fi
if [ $DATASET = "train" ]
then
##DATA_DIR="/Users/alolex/Desktop/VCU_PhD_Work/Chrono/data/THYME"
##DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/THYME_subset"
DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/i2b2_train"
##OUT_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/results"
OUT_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/results/i2b2_train/"
ML_DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/sample_files"
fi
if [ $DATASET = "eval" ]
then
DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/i2b2_eval"
OUT_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/results/i2b2_eval"
##DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/data/SemEval-Task6-Evaluation"
##OUT_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/results/newsEval"
ML_DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/sample_files"
fi
if [ $DATASET = "berttrain" ]
then
##DATA_DIR="/Users/alolex/Desktop/VCU_PhD_Work/Chrono/data/THYME"
##DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/THYME_subset"
DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/i2b2_train"
##OUT_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/results"
OUT_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/results_bert/i2b2_train/"
ML_DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/sample_files"
fi
if [ $DATASET = "berteval" ]
then
DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/i2b2_eval"
OUT_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/results_bert/i2b2_eval"
ML_DATA_DIR="/Users/alolex/Desktop/CCTR_Git_Repos/Chrono/sample_files"
fi
if [ $ML_DATA = "news5" ]
then
ML_DATA_FILE="official_train_MLmatrix_Win5_012618_data.csv"
ML_CLASS_FILE="official_train_MLmatrix_Win5_012618_class.csv"
fi
if [ $ML_DATA = "newsclin5" ]
then
ML_DATA_FILE="Newswire-THYMEColon_train_Win5_data.csv"
ML_CLASS_FILE="Newswire-THYMEColon_train_Win5_class.csv"
fi
if [ $ML_DATA = "clin5" ]
then
ML_DATA_FILE="THYMEColon_train_Win5_data.csv"
ML_CLASS_FILE="THYMEColon_train_Win5_class.csv"
fi
if [ $ML_DATA = "newsclin3" ]
then
ML_DATA_FILE="Newswire-THYMEColon_train_Win3_data.csv"
ML_CLASS_FILE="Newswire-THYMEColon_train_Win3_class.csv"
fi
if [ $ML_DATA = "news3" ]
then
ML_DATA_FILE="official_train_MLmatrix_Win3_data.csv"
ML_CLASS_FILE="official_train_MLmatrix_Win3_class.csv"
fi
fi
if [ $LOC = "willow" ]
then
ANAFORA_DIR="/home/alolex/ChronoAnalysis_031918/anaforatools"
if [ $DATASET = "test" ]
then
DATA_DIR="/home/share/data/THYME/ColonTrainData/input"
OUT_DIR="/home/alolex/ChronoAnalysis_031918/ChronoResults/colonTrain_baselineTest"
ML_DATA_DIR="/home/alolex/ChronoAnalysis_031918/Chrono/sample_files"
fi
if [ $DATASET = "train" ]
then
DATA_DIR="/home/alolex/THYME_Data/THYMEColonFinal_Train/input"
OUT_DIR="/home/alolex/ChronoAnalysis_031918/ChronoResults/colonTrain_dev2"
ML_DATA_DIR="/home/alolex/ChronoAnalysis_031918/Chrono/sample_files"
fi
if [ $DATASET = "eval" ]
then
DATA_DIR="/home/share/data/THYME/ChronoEval/THYMEColonFinal/Dev"
OUT_DIR="/home/alolex/ChronoAnalysis_031918/ChronoResults/colonEval073018"
ML_DATA_DIR="/home/alolex/ChronoAnalysis_031918/Chrono/sample_files"
fi
if [ $ML_DATA = "news5" ]
then
ML_DATA_FILE="official_train_MLmatrix_Win5_012618_data.csv"
ML_CLASS_FILE="official_train_MLmatrix_Win5_012618_class.csv"
fi
if [ $ML_DATA = "newsclin5" ]
then
ML_DATA_FILE="Newswire-THYMEColon_train_Win5_data.csv"
ML_CLASS_FILE="Newswire-THYMEColon_train_Win5_class.csv"
fi
if [ $ML_DATA = "clin5" ]
then
ML_DATA_FILE="THYMEColon_train_Win5_data.csv"
ML_CLASS_FILE="THYMEColon_train_Win5_class.csv"
fi
if [ $ML_DATA = "newsclin3" ]
then
ML_DATA_FILE="Newswire-THYMEColon_train_Win3_data.csv"
ML_CLASS_FILE="Newswire-THYMEColon_train_Win3_class.csv"
fi
if [ $ML_DATA = "news3" ]
then
ML_DATA_FILE="official_train_MLmatrix_Win3_data.csv"
ML_CLASS_FILE="official_train_MLmatrix_Win3_class.csv"
fi
fi
if [ $DATASET = "eval" ]
then
if [ $REL = "rel" ]
then
python Chrono.py -I $DATA_DIR -O $OUT_DIR -m $ML -d $ML_DATA_DIR/$ML_DATA_FILE -c $ML_DATA_DIR/$ML_CLASS_FILE --includeRelative
echo "COMMAND:"
echo python Chrono.py -I $DATA_DIR -O $OUT_DIR -m $ML -d $ML_DATA_DIR/$ML_DATA_FILE -c $ML_DATA_DIR/$ML_CLASS_FILE --includeRelative
else
python Chrono.py -I $DATA_DIR -O $OUT_DIR -m $ML -d $ML_DATA_DIR/$ML_DATA_FILE -c $ML_DATA_DIR/$ML_CLASS_FILE
echo "COMMAND:"
echo python Chrono.py -I $DATA_DIR -O $OUT_DIR -m $ML -d $ML_DATA_DIR/$ML_DATA_FILE -c $ML_DATA_DIR/$ML_CLASS_FILE
fi
else
if [ $REL = "rel" ]
then
python Chrono.py -I $DATA_DIR -O $OUT_DIR -m $ML -d $ML_DATA_DIR/$ML_DATA_FILE -c $ML_DATA_DIR/$ML_CLASS_FILE --includeRelative
echo "COMMAND:"
echo python Chrono.py -I $DATA_DIR -O $OUT_DIR -m $ML -d $ML_DATA_DIR/$ML_DATA_FILE -c $ML_DATA_DIR/$ML_CLASS_FILE --includeRelative
else
python Chrono.py -I $DATA_DIR -O $OUT_DIR -m $ML -d $ML_DATA_DIR/$ML_DATA_FILE -c $ML_DATA_DIR/$ML_CLASS_FILE
echo "COMMAND:"
echo python Chrono.py -I $DATA_DIR -O $OUT_DIR -m $ML -d $ML_DATA_DIR/$ML_DATA_FILE -c $ML_DATA_DIR/$ML_CLASS_FILE
fi
#cd $ANAFORA_DIR
#echo "EVERYTHING"
#python -m anafora.evaluate -r $DATA_DIR -p $OUT_DIR
#echo "EXCLUDE EVENT"
#python -m anafora.evaluate -r $DATA_DIR -p $OUT_DIR --exclude Event
#echo "EXCLUDE EVENT AND OVERLAP SPANS"
#python -m anafora.evaluate -r $DATA_DIR -p $OUT_DIR --exclude Event --overlap
#echo "INCLUDE ONLY WHAT WE PARSE AND OVERLAP SPANS"
#python -m anafora.evaluate -r $DATA_DIR -p $OUT_DIR --exclude Event Between Every-Nth Frequency Intersection NotNormalizable PreAnnotation Sum Union --overlap
fi
#echo "COMMANDS:"
#echo python Chrono.py -i $DATA_DIR -o $OUT_DIR -m $ML -d $ML_DATA_DIR/$ML_DATA_FILE -c $ML_DATA_DIR/$ML_CLASS_FILE
#echo python -m anafora.evaluate -r $DATA_DIR -p $OUT_DIR
echo "COMPLETED"
elif [ $USER = "luke" ]
then
if [ $LOC = "laptop" ]
then
ANAFORA_DIR="/Users/alolex/Desktop/VCU_PhD_Work/Chrono/anaforatools"
if [ $DATASET = "test" ]
then
DATA_DIR="/Users/alolex/Desktop/VCU_PhD_Work/Chrono/data/THYME"
OUT_DIR="/Users/alolex/Desktop/VCU_PhD_Work/Chrono/results/Colon_dev"
ML_DATA_DIR="/Users/alolex/Desktop/VCU_PhD_Work/Chrono/sample_files"
fi
if [ $DATASET = "train" ]
then
DATA_DIR="/Users/alolex/Desktop/VCU_PhD_Work/Chrono/data/THYME"
OUT_DIR="/Users/alolex/Desktop/VCU_PhD_Work/Chrono/results/Colon_dev"
ML_DATA_DIR="/Users/alolex/Desktop/VCU_PhD_Work/Chrono/sample_files"
fi
if [ $ML_DATA = "news5" ]
then
ML_DATA_FILE="official_train_MLmatrix_Win5_012618_data.csv"
ML_CLASS_FILE="official_train_MLmatrix_Win5_012618_class.csv"
fi
if [ $ML_DATA = "newsclin5" ]
then
ML_DATA_FILE="Newswire-THYMEColon_train_Win5_data.csv"
ML_CLASS_FILE="Newswire-THYMEColon_train_Win5_class.csv"
fi
if [ $ML_DATA = "clin5" ]
then
ML_DATA_FILE="THYMEColon_train_Win5_data.csv"
ML_CLASS_FILE="THYMEColon_train_Win5_class.csv"
fi
if [ $ML_DATA = "newsclin3" ]
then
ML_DATA_FILE="Newswire-THYMEColon_train_Win3_data.csv"
ML_CLASS_FILE="Newswire-THYMEColon_train_Win3_class.csv"
fi
if [ $ML_DATA = "news3" ]
then
ML_DATA_FILE="official_train_MLmatrix_Win3_data.csv"
ML_CLASS_FILE="official_train_MLmatrix_Win3_class.csv"
fi
fi
if [ $LOC = "willow" ]
then
ANAFORA_DIR="/home/maffeyl/anafora/anaforatools"
if [ $DATASET = "test" ]
then
DATA_DIR="/home/share/data/THYME/ColonTrainData/input"
OUT_DIR="/home/maffeyl/ChronoResults/colonTrain_baselineTest"
ML_DATA_DIR="/home/maffeyl/Chrono/sample_files"
fi
if [ $DATASET = "train" ]
then
DATA_DIR="/home/alolex/THYME_Data/THYMEColonFinal_Train/input"
OUT_DIR="/home/maffeyl/ChronoResults/colonTrain_dev2"
ML_DATA_DIR="/home/maffeylChrono/sample_files"
fi
if [ $ML_DATA = "news5" ]
then
ML_DATA_FILE="official_train_MLmatrix_Win5_012618_data.csv"
ML_CLASS_FILE="official_train_MLmatrix_Win5_012618_class.csv"
fi
if [ $ML_DATA = "newsclin5" ]
then
ML_DATA_FILE="Newswire-THYMEColon_train_Win5_data.csv"
ML_CLASS_FILE="Newswire-THYMEColon_train_Win5_class.csv"
fi
if [ $ML_DATA = "clin5" ]
then
ML_DATA_FILE="THYMEColon_train_Win5_data.csv"
ML_CLASS_FILE="THYMEColon_train_Win5_class.csv"
fi
if [ $ML_DATA = "newsclin3" ]
then
ML_DATA_FILE="Newswire-THYMEColon_train_Win3_data.csv"
ML_CLASS_FILE="Newswire-THYMEColon_train_Win3_class.csv"
fi
if [ $ML_DATA = "news3" ]
then
ML_DATA_FILE="official_train_MLmatrix_Win3_data.csv"
ML_CLASS_FILE="official_train_MLmatrix_Win3_class.csv"
fi
fi
python Chrono.py -i $DATA_DIR -o $OUT_DIR -m $ML -d $ML_DATA_DIR/$ML_DATA_FILE -c $ML_DATA_DIR/$ML_CLASS_FILE
cd $ANAFORA_DIR
python -m anafora.evaluate -r $DATA_DIR -p $OUT_DIR --exclude Event
fi