-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
47 lines (38 loc) · 1.48 KB
/
install.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
# front-end use React
# so need to use webpack and bower
npm install
npm install -g bower
./node_modules/.bin/webpack --config webpack.config.index.js
./node_modules/.bin/webpack --config webpack.config.api.js
./node_modules/.bin/webpack --config webpack.config.member.js
# cause bower do not allow execute in root
# so change into another user to install all front-end package we need.
useradd -ms /bin/bash newuser
chown -R newuser:newuser .
sudo -u newuser -H sh -c "python3 /code/manage.py bower install"
# build all text mining model
# if may take few hours to few days
echo "build model in language ${1}";
# migrate
python3 manage.py migrate
# build model kcm
python3 manage.py buildKcm --lang ${1} --cpus 20
# build model KEM
python3 manage.py buildkem --lang ${1} --dimension 400
# build model kcem
python3 manage.py buildkcem --lang ${1} --cpus 6
# After building an ontology consisting of isA relation
# we can use it to build a enhanced word2vec with hypernym
python3 manage.py buildkem --lang ${1} --dimension 400 --cpus 6 --ontology True
# build model PMI
python3 manage.py buildPMI --lang ${1}
# build model TF
python3 manage.py buildTfidf --lang ${1}
echo '-----------------------------------'
echo "all api is available now"
echo "only some duplicate key of kcem need to be merged"
echo "this process would take some times, maybe few days to few weeks"
echo "but it's totally ok to skip this process"
echo '-----------------------------------'
python3 manage.py mergeKcem --lang ${1}
exit 0