-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathalgorec-run.sh
executable file
·63 lines (61 loc) · 1.07 KB
/
algorec-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
#!/bin/bash
# Author: Tarek, Maged
# Date: 2.9.15
# Algorithm recognition pipeline
# assuming that source-code dir (crawler.py output) is there:
create_xmls=0
create_features=0
classify=0
div=0
while getopts ":cfd12ag" opt; do
case $opt in
d)
echo "-d was triggered!" >&2
create_xmls=1
;;
f)
create_features=1
echo "-f triggered" >&2
;;
c)
classify=1
echo "-c triggered" >&2
;;
1)
div='data-div-1/'
;;
2)
div='data-div-2/'
;;
a)
div='data-all/'
;;
g)
div='data-grading/'
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
done
# constructs data dir
if [ $create_xmls -eq 1 ]
then
# rm -rf $div
python3 construct_dirs.py
# create xml files and clean them
bash srcml_and_clean.sh $div
fi
# extract features to be saved in features.pickle
if [ $create_features -eq 1 ]
then
# rm features.pickle
python3 features.py
fi
# start classification
if [ $classify -eq 1 ]
then
echo "Classify"
python3 update_tags.py
python3 classifier.py
fi