-
Notifications
You must be signed in to change notification settings - Fork 1
/
rrun-c-abbreviation-detection-batch.sh
executable file
·68 lines (58 loc) · 3.12 KB
/
rrun-c-abbreviation-detection-batch.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
#!/bin/bash
source ./rrun.env.sh
SOURCE_PATH="${WORK_BUCKET}/code-dependencies/ab3p-abbreviation/"
########## CHOOSE MEDLINE OR PMCOA
#### MEDLINE
# TEXT_PIPELINE_KEY=MEDLINE_XML_TO_TEXT
# TEXT_PIPELINE_VERSION="recent"
# SUBSET_PREFIX=PUBMED_SUB_
# MAX_SUBSET_INDEX=36
#### PMCOA
TEXT_PIPELINE_KEY=FILTER_UNACTIONABLE_TEXT
TEXT_PIPELINE_VERSION="0.1.0"
SUBSET_PREFIX=PMC_SUBSET_
# MAX_SUBSET_INDEX=41
MAX_SUBSET_INDEX=40
SCRIPT=./scripts/pipelines/concepts/run_abbreviations.sh
WORKER_PATH=/tmp/abbrev
OVERWRITE=YES
SENTENCE_PIPELINE_KEY="SENTENCE_SEGMENTATION"
SENTENCE_PIPELINE_VERSION="recent"
OUTPUT_PIPELINE_VERSION="0.3.0"
# # use the below to run a single collection
# echo "Starting abbreviation detection pipeline..."
# COLLECTION=PMC_SUBSET_0
# # COLLECTION=TEST_41
# # COLLECTION=TEST_ABBREV_NPE
# $SCRIPT $SOURCE_PATH $WORKER_PATH $TEXT_PIPELINE_KEY $TEXT_PIPELINE_VERSION $SENTENCE_PIPELINE_KEY $SENTENCE_PIPELINE_VERSION $OUTPUT_PIPELINE_VERSION $PROJECT_ID ${COLLECTION} ${STAGE_LOCATION} ${TEMP_LOCATION} ${JAR_VERSION} ${OVERWRITE} &> "./logs/abbreviation-detect-${COLLECTION}.log" &
for INDEX in $(seq 1 4 $MAX_SUBSET_INDEX)
do
ind=$(($INDEX + 0))
if (( ind <= $MAX_SUBSET_INDEX)); then
echo "Starting abbreviation detection pipeline... ${ind} $(date)"
COLLECTION="${SUBSET_PREFIX}${ind}"
$SCRIPT $SOURCE_PATH $WORKER_PATH $TEXT_PIPELINE_KEY $TEXT_PIPELINE_VERSION $SENTENCE_PIPELINE_KEY $SENTENCE_PIPELINE_VERSION $OUTPUT_PIPELINE_VERSION $PROJECT_ID ${COLLECTION} ${STAGE_LOCATION} ${TEMP_LOCATION} ${JAR_VERSION} ${OVERWRITE} &> ./logs/abbreviation-detect-${COLLECTION}.log &
sleep 120
fi
ind=$(($INDEX + 1))
if (( ind <= $MAX_SUBSET_INDEX)); then
echo "Starting abbreviation detection pipeline... ${ind} $(date)"
COLLECTION="${SUBSET_PREFIX}${ind}"
$SCRIPT $SOURCE_PATH $WORKER_PATH $TEXT_PIPELINE_KEY $TEXT_PIPELINE_VERSION $SENTENCE_PIPELINE_KEY $SENTENCE_PIPELINE_VERSION $OUTPUT_PIPELINE_VERSION $PROJECT_ID ${COLLECTION} ${STAGE_LOCATION} ${TEMP_LOCATION} ${JAR_VERSION} ${OVERWRITE} &> ./logs/abbreviation-detect-${COLLECTION}.log &
sleep 120
fi
ind=$(($INDEX + 2))
if (( ind <= $MAX_SUBSET_INDEX)); then
echo "Starting abbreviation detection pipeline... ${ind} $(date)"
COLLECTION="${SUBSET_PREFIX}${ind}"
$SCRIPT $SOURCE_PATH $WORKER_PATH $TEXT_PIPELINE_KEY $TEXT_PIPELINE_VERSION $SENTENCE_PIPELINE_KEY $SENTENCE_PIPELINE_VERSION $OUTPUT_PIPELINE_VERSION $PROJECT_ID ${COLLECTION} ${STAGE_LOCATION} ${TEMP_LOCATION} ${JAR_VERSION} ${OVERWRITE} &> ./logs/abbreviation-detect-${COLLECTION}.log &
sleep 120
fi
ind=$(($INDEX + 3))
if (( ind <= $MAX_SUBSET_INDEX)); then
echo "Starting abbreviation detection pipeline... ${ind} $(date)"
COLLECTION="${SUBSET_PREFIX}${ind}"
$SCRIPT $SOURCE_PATH $WORKER_PATH $TEXT_PIPELINE_KEY $TEXT_PIPELINE_VERSION $SENTENCE_PIPELINE_KEY $SENTENCE_PIPELINE_VERSION $OUTPUT_PIPELINE_VERSION $PROJECT_ID ${COLLECTION} ${STAGE_LOCATION} ${TEMP_LOCATION} ${JAR_VERSION} ${OVERWRITE} &> ./logs/abbreviation-detect-${COLLECTION}.log &
fi
wait
done