-
Notifications
You must be signed in to change notification settings - Fork 5
/
run.sh
executable file
·37 lines (32 loc) · 1.45 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
#!/bin/bash
data=$1
model=$2
classifier=$3
if [ "$classifier" == "liblinear" ]; then
steps=$4 #scale,tune,pred
trainparsefile="$5" #../data/lidong/parses/lidong.train.conll
testparsefile="$6" #../data/lidong/parses/lidong.test.conll
c="$7" #C parameter; when parameter tuning is not desired; optional
elif [ "$classifier" == "sklearnSVM" ]; then
trainparsefile="$4" #../data/lidong/parses/lidong.train.conll
testparsefile="$5" #../data/lidong/parses/lidong.test.conll
else
echo "Please make sure to use appropriate model and classifier."
fi
if [ "$model" == "naiveseg" ] && [ "$classifier" == "liblinear" ]; then
python naive-seg.py --data "$data"
python liblinear.py --data "$data" --steps "$steps" --c "$c"
elif [ "$model" == "tdparse" ] && [ "$classifier" == "liblinear" ]; then
python tdparse.py --data "$data" --trainparse "$trainparsefile" --testparse "$testparsefile"
python liblinear.py --data "$data" --steps "$steps" --c "$c"
elif [ "$model" == "naiveseg" ] && [ "$classifier" == "sklearnSVM" ]; then
python naive-seg.py --data "$data"
python liblinear.py --data "$data" --steps scale
python sklearnSVM.py --data "$data"
elif [ "$model" == "tdparse" ] && [ "$classifier" == "sklearnSVM" ]; then
python tdparse.py --data "$data" --trainparse "$trainparsefile" --testparse "$testparsefile"
python liblinear.py --data "$data" --steps scale
python sklearnSVM.py --data "$data"
else
echo "Please make sure to use appropriate model and classifier."
fi