-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·78 lines (69 loc) · 2.3 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
function timer()
{
if [[ $# -eq 0 ]]; then
echo $(date '+%s')
else
local stime=$1
etime=$(date '+%s')
if [[ -z "$stime" ]]; then stime=$etime; fi
dt=$((etime - stime))
ds=$((dt % 60))
dm=$(((dt / 60) % 60))
dh=$((dt / 3600))
printf '%d:%02d:%02d' $dh $dm $ds
fi
}
EXPECTED_ARGS=1
E_BADARGS=65
if [ $# -ne $EXPECTED_ARGS ]
then
echo
echo "(!) Usage: $0 /path/to/<list_uris_file>.txt"
echo
exit $E_BADARGS
fi
clear
#echo "The script starts now."
#echo
SERVICE_URIS_PATH=$1
echo "The whole 'topicalization' process is performed in two steps: "
echo " * Step 1: Retrieving and processing the service descriptors."
echo " * Step 2: Running Online LDA over the information regarding service operations."
echo
read -p "Press [Enter] key to start ..."
echo
echo "--> Starting Step 1: Retrieving and processing the service descriptors."
echo
t=$(timer)
# without proxy:
java -jar WebAPIDocProcessing.jar $SERVICE_URIS_PATH .doc/
#
# with proxy:
#java -Dhttp.useProxy=true -Dhttp.proxyHost='proxy.unicauca.edu.co' -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts='127.0.0.1|localhost' -jar WebAPIDocProcessing.jar $SERVICE_URIS_PATH .doc/
echo
echo
echo "Documentation Processing Done!"
echo
cd onlinelda
#echo "I will now fetch you a list of connected users:"
printf 'Elapsed time step 1: %s\n' $(timer $t)
echo
echo "--> Starting Step 2: Running Online LDA over the information regarding service operations."
echo
python online_lda_wsdl.py ../.doc/
#python printtopics.py dictnostops.txt parameters/lambda-all.dat 15
python printtopics.py wlist_match10.txt parameters/lambda-all.dat 15
python printtopicdistributions.py parameters/gamma-all.dat 3
# generating JSON output
python ./json_handler/jsonify.py ../outcome/per-document-topics.csv
cp ../outcome/per-document-topics.json /home/leandro/NetBeansProjects/TopicalizerBrowser/web/datasources
cp ../outcome/per-document-topics.csv /home/leandro/NetBeansProjects/TopicalizerBrowser/web/datasources
cp ../outcome/topics.csv /home/leandro/NetBeansProjects/TopicalizerBrowser/web/datasources
#w
echo "Topic Model Done..."
echo
printf 'Elapsed time: %s\n' $(timer $t)
echo
echo "That's it! now explore the operation categorization at: http://localhost:8080/openrdf-workbench/repositories/WebAPIModel"
echo