-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a60562a
Showing
8 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.zip | ||
*.tar.gz | ||
externalData/GNormPlusJava/Dictionary/ | ||
externalData/GNormPlusJava/CRF/ | ||
externalData/tmVarJava/Database/ | ||
externalData/tmVarJava/CRF/ | ||
externalData/data/ | ||
externalData/biobert_ner_models/ | ||
externalData/resources/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
externalData/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "bern"] | ||
path = bern | ||
url = https://github.com/amalic/bern.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
FROM tensorflow/tensorflow:1.13.1-gpu-py3 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y wget default-jre | ||
|
||
WORKDIR /app | ||
COPY externalData/GNormPlusJava/ ./GNormPlusJava/ | ||
COPY externalData/tmVarJava/ ./tmVarJava/ | ||
COPY externalData/CRF++-0.58/ ./GNormPlusJava/CRF/ | ||
COPY externalData/CRF++-0.58/ ./tmVarJava/CRF/ | ||
|
||
COPY bern/ . | ||
RUN pip install -r requirements.txt | ||
|
||
WORKDIR /app | ||
RUN cd GNormPlusJava && \ | ||
cd CRF && \ | ||
sh ./configure && \ | ||
make && \ | ||
make install && \ | ||
cd .. && \ | ||
chmod 764 Ab3P && \ | ||
sed -i 's/= All/= 9606/g' setup.txt; echo "FocusSpecies: from All to 9606 (Human)" && \ | ||
sh Installation.sh && \ | ||
wget -O GNormPlusServer.jar --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1g-JlhqeDIlZX5YFk8Y27_M8BXUXcQRSX' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1g-JlhqeDIlZX5YFk8Y27_M8BXUXcQRSX" && \ | ||
rm -rf /tmp/cookies.txt | ||
|
||
WORKDIR /app | ||
RUN cd tmVarJava && \ | ||
cd CRF && \ | ||
sh ./configure && \ | ||
make && \ | ||
make install && \ | ||
cd ..&& \ | ||
chmod 764 CRF/crf_test && \ | ||
sh Installation.sh && \ | ||
wget -O tmVar2Server.jar --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1kQYzLHLFLsU9qKpRRGjXkIYmaYK6bPJm' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1kQYzLHLFLsU9qKpRRGjXkIYmaYK6bPJm" && \ | ||
rm -rf /tmp/cookies.txt && \ | ||
wget https://repo1.maven.org/maven2/org/xerial/sqlite-jdbc/3.20.0/sqlite-jdbc-3.20.0.jar && \ | ||
wget https://repo1.maven.org/maven2/edu/stanford/nlp/stanford-corenlp/3.5.2/stanford-corenlp-3.5.2.jar | ||
|
||
WORKDIR /app | ||
RUN mkdir logs | ||
COPY entrypoint.sh . | ||
|
||
EXPOSE 8888 | ||
|
||
ENTRYPOINT ["bash", "-c"] | ||
CMD ["/app/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## Prerequisites | ||
Lot's of disk space | ||
|
||
Download following files first: | ||
- GNormPlus.zip: https://www.ncbi.nlm.nih.gov/CBBresearch/Lu/Demo/tmTools/download/GNormPlus/GNormPlusJava.zip | ||
- tmVarJava.zip: ftp://ftp.ncbi.nlm.nih.gov/pub/lu/Suppl/tmVar2/tmVarJava.zip | ||
- CRF++-0.58.tar.gz: https://drive.google.com/uc?id=0B4y35FiV1wh7QVR6VXJ5dWExSTQ | ||
- biobert_ner_models.zip: https://docs.google.com/uc?export=download&id=1sSVEqvMBVLj1RJmlQDhRKyt_oe-wc5LK | ||
- data.zip: https://docs.google.com/uc?export=download&id=1NqgG3zJzopG2IqG-0g1o6fH0xVpO4PPN | ||
- resources.zip: https://docs.google.com/uc?export=download&id=1uU1U6UORqr3l_YYQ5TXeazpLrpeg_OcP | ||
|
||
Extract all archives into externalData folder, and delete the archives if not needed any more for other purposes. | ||
|
||
## Build | ||
``` | ||
docker build -t bern-docker | ||
``` | ||
|
||
## Run | ||
``` | ||
docker run -it --gpus all -p 80:8888 \ | ||
-v $PWD/externalData/GNormPlusJava/Dictionary/:/app/GNormPlusJava/Dictionary/ \ | ||
-v $PWD/externalData/tmVarJava/Database:/app/tmVarJava/Database \ | ||
-v $PWD/externalData/biobert_ner_models/:/app/bern/biobert_ner/ \ | ||
-v $PWD/externalData/data/:/app/normalization/data/ \ | ||
-v $PWD/externalData/resources/:/app/normalization/resources/ \ | ||
bern-docker | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: "3" | ||
|
||
services: | ||
|
||
bern: | ||
build: . | ||
ports: | ||
- 80:8888 | ||
volumes: | ||
- ./externalData/GNormPlusJava/Dictionary/:/app/GNormPlusJava/Dictionary/ | ||
- ./externalData/tmVarJava/Database:/app/tmVarJava/Database | ||
- ./externalData/biobert_ner_models?:/app/bern/biobert_ner/ | ||
- ./externalData/data/:/app/normalization/data/ | ||
- ./externalData/resources/:/app/normalization/resources/ | ||
networks: | ||
- bernnet | ||
|
||
networks: | ||
bernnet: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
cd GNormPlusJava/ | ||
nohup java -Xmx16G -Xms16G -jar GNormPlusServer.jar 18895 2>&1 & | ||
cd ../tmVarJava | ||
nohup java -Xmx8G -Xms8G -jar tmVar2Server.jar 18896 2>&1 & | ||
cd .. | ||
|
||
sh load_dicts.sh | ||
|
||
python3 -u server.py --port 8888 --gnormplus_home /app/GNormPlusJava --gnormplus_port 18895 --tmvar2_home /app/tmVarJava --tmvar2_port 18896 |