-
Notifications
You must be signed in to change notification settings - Fork 20
/
setup.sh
executable file
·72 lines (60 loc) · 2.2 KB
/
setup.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
function init
{
echo "Installing basic requirements"
pip install gdown
pip install pytorch_pretrained_bert
pip install pytorch_transformers
pip install scikit-learn
pip install transformers
apt-get install wget
}
function fetch
{
echo "Fetching models"
./fetch_models.sh
echo "Fetching entity vectors"
./fetch_labels.sh
}
function install_bert_desc
{
param=$1
git clone https://github.com/ajitrajasekharan/bert_descriptors.git
if [ $param -eq 2 ]
then
echo "Starting BBC descriptor service"
(cd bert_descriptors; cp ../../../models/bbc/* . ; cp ../../../labels/bbc_labels.txt ./labels.txt; cp ../../../labels/desc_bbc_config.json ./server_config.json; echo "python p3_batch_server.py 8088" > ./run_batched_response_servers.sh ; ./run_batched_response_servers.sh &)
else
echo "Starting BIO descriptor service"
(cd bert_descriptors; cp ../../../models/a100/* . ;cp ../../../labels/a100_labels.txt ./labels.txt; cp ../../../labels/desc_a100_config.json ./server_config.json ; ./run_batched_response_servers.sh &)
fi
}
function install_ner
{
param=$1
git clone https://github.com/ajitrajasekharan/unsupervised_NER.git
if [ $param -eq 2 ]
then
echo "Starting BBC NER service"
(cd unsupervised_NER; cp ../../../labels/ner_bbc_config.json ./config.json; echo "python batched_p3_server.py 9089" > ./batched_run_server.sh; ./batched_run_server.sh & )
else
echo "Starting BIO NER service"
(cd unsupervised_NER; cp ../../../labels/ner_a100_config.json ./config.json; ./batched_run_server.sh &)
fi
}
function microservices
{
echo "Installing microservices"
mkdir -p services
(cd services;mkdir -p bio; cd bio; install_bert_desc 1; install_ner 1; )
(cd services;mkdir -p phi; cd phi; install_bert_desc 2; install_ner 2; )
echo "Starting ensemble server"
(cd ensemble; ./run_server_json.sh &)
echo "Testing install with query"
sleep 5
wget -O test "http://127.0.0.1:8059/dummy/Lou:__entity__ Gehrig:__entity__ who works in XCorp:__entity__ suffers from Parkinson's:__entity__"
echo "output saved in test"
more test
}
init
fetch
microservices