- Update ubuntu packages
sudo apt-get update
- Install Python3
sudo apt-get install python3.6
- Check if Python3 is installed
python3.6 --version
- Install pip for Python3.6
sudo apt-get install python3.6-pip
- Install virtualenv
sudo pip3.6 install virtualenv
- Create the virtualenv
virtualenv --python=python3.6 venv
- Activate virtualenv using
. venv/bin/activate
- cd into the main repo.
- Run the following commands
-
# set up keys curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - # Update files and install default-jre apt-get update apt-get install default-jre -y # Install JDK apt-get install default-jdk -y # Install Oracle JDK add-apt-repository ppa:webupd8team/java apt-get update # Install JDK 9 apt-get install oracle-java8-installer -y
-
# Import the Elasticsearch PGP key wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - # Install transport-https package apt-get install apt-transport-https -y echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-6.x.list # Install elastic-search apt-get update apt-get install elasticsearch -y # Running Elasticsearch with systemd /bin/systemctl daemon-reload /bin/systemctl enable elasticsearch.service # Start elasticsearch systemctl start elasticsearch.service # Make a GET request, to check if elasticsearch node is running # curl -X GET "localhost:9200/" # Install the libraries from pip pip install -r requirements.txt
- Press
enter
when prompted. - You will be asked to accept the license for installing java when prompted. Press enter to accept the license
- Open the main folder. Change directory into ElasticData
cd ElasticData
- Now run
cd TheFinalJson
curl localhost:9200/cases/_bulk -H "Content-type:application/json" -X POST --data-binary @CasesFinal.json
- Go back using
cd ..
- Go to
acts
and run
cd acts
curl localhost:9200/acts/_bulk -H "Content-type:application/json" -X POST --data-binary @Acts.json
- Come back to the main repo using
cd ../..
- Run from the main repository
chmod +x run_node.sh
and
sudo run_node.sh
to install node dependencies. 2. cd into the
cd node
folder. Run
node server.js
- Download the trained model
wget 0 https://storage.googleapis.com/bert_models/2018_10_18/uncased_L-12_H-768_A-12.zip
- Unzip the trained model into the main repo using
unzip uncased_L-12_H-768_A-12.zip
- Make temp_files
mkdir temp_files
in the main repo.
- Open another terminal and open the main repository.
- cd into temp_files
cd temp_files
- Run
bert-serving-start -model_dir ../uncased_L-12_H-768_A-12 -num_worker=1 -max_seq_len=500
- Open another terminal and open the main repo.
- Change directory to node
cd node
to cd into the node directory. 3. Run
node server.js
for starting the server.
- Open another terminal and open the main repo
- Run
python server.py