-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·45 lines (35 loc) · 1.61 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
#!/bin/bash
CORPORA="../team-lab-ss2015/data/pos"
train=0
test=0
evaluate=0
tag=0
#head -20000 $CORPORA/train.col >> $CORPORA/train_top5000.col
#head -20000 $CORPORA/dev.col >> $CORPORA/dev_top5000.col
python -u 10-fold-cross-validation.py -i $CORPORA/train.col -t 1 -s 10 -o1 one_fold.col -o2 nine_folds.col
if [ "$train" = 1 ]; then
#python -u tagger.py -train -i $CORPORA/train.col -e 5 -m model
#python -u tagger.py -train -i $CORPORA/train_top5000.col -t $p -e 5 -m $MODELS/model$COUNTER
python -u tagger.py -train -i $CORPORA/train.col -e 10 -m model -decrease-alpha -shuffle-tokens -batch-training
fi
# Test the model
if [ "$test" = 1 ]; then
python -u tagger.py -test -i $CORPORA/dev.col -m model -o prediction.col
#python -u tagger.py -test -i $CORPORA/dev_top5000.col -m $MODELS/model$COUNTER -o $PREDICTIONS/prediction$COUNTER.col
#python tagger.py -test -i $CORPORA/dev_top5000.col -m model -o prediction.col
fi
# Evaluate the results
if [ "$evaluate" = 1 ]; then
python -u tagger.py -ev -i prediction.col -o evaluation.txt
#python -u tagger.py -ev -i $CORPORA/test_stuff/nn.col -o evaluation.txt
#python -u tagger.py -ev -i $CORPORA/test_stuff/leer.col -o evaluation.txt
fi
# Test the model
if [ "$tag" = 1 ]; then
python -u tagger.py -tag -i $CORPORA/test-nolabels.col -m model -o prediction.col
#python -u tagger.py -test -i $CORPORA/dev_top5000.col -m $MODELS/model$COUNTER -o $PREDICTIONS/prediction$COUNTER.col
#python tagger.py -test -i $CORPORA/dev_top5000.col -m model -o prediction.col
fi
# Tag plain text file
#rm $CORPORA/train_top5000.col
#rm $CORPORA/dev_top5000.col