-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·47 lines (36 loc) · 1.79 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
#!/bin/bash
#CORPORA="../team-lab-ss2015/data/reviews/usage-iob"
CORPORA="../team-lab-ss2015/data/reviews/usage-iob-pos-converted"
train=1
test=1
evaluate=1
tag=0
#head -20000 $CORPORA/train.col >> $CORPORA/train_top5000.col
#head -20000 $CORPORA/dev.col >> $CORPORA/dev_top5000.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 named-entity-recognizer.py -train -i $CORPORA/train.iob -e 100 -m model -decrease-alpha -batch-training -shuffle-sentences
fi
# Test the model
if [ "$test" = 1 ]; then
python -u named-entity-recognizer.py -test -i $CORPORA/converted_pos_tagged_en-washer-a1-target.iob -m model -o prediction.col
#python -u named-entity-recognizer.py -test -i $CORPORA/en-washer-a1-target.iob -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 named-entity-recognizer.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