-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun.sh
57 lines (45 loc) · 1.36 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
#!/bin/bash
PYTHON=/home/$USER/python2.7/bin/python
labels_count=(600 700 800 900 1000 2500 5000 10000)
topwords_count=(7000 8000 9000 10000 15000 20000 50000)
ALL=2
ALLBESTLCOUNT=600
ALLBESTWCOUNT=8000
ALLBESTLCOUNT=50000
ALLBESTWCOUNT=100000
function run()
{
echo "-------------------running-----------------------"
$PYTHON gen_train_data.py $ALLBESTLCOUNT > out 2>&1
$PYTHON preprocess.py $ALLBESTWCOUNT > out 2>&1
echo "-------label: $ALLBESTLCOUNT----topwords: $ALLBESTWCOUNT-------"
rate=`$PYTHON classify.py 0`
$PYTHON tags_feature.py
$PYTHON gen_results.py
echo "------------correct rate: $rate------------------"
echo "-----------------end running---------------------"
}
function run_test()
{
echo "-------------------testing-----------------------"
for lcount in ${labels_count[@]}
do
$PYTHON gen_train_data.py $lcount > out 2>&1
for wcount in ${topwords_count[@]}
do
correct_rate=`for_test_ALL $wcount`
echo "---labels count: $lcount---topwords count: $wcount---coreect rate: $correct_rate---"
done
done
echo "-----------------end testing---------------------"
}
function for_test_ALL()
{
wcount=$1
$PYTHON preprocess.py $wcount > out 2>&1
rate=`$PYTHON classify.py 1`
echo $rate
return 0
}
run_test
#run