-
Notifications
You must be signed in to change notification settings - Fork 4
/
4_annotate_articles.sh
84 lines (57 loc) · 2.39 KB
/
4_annotate_articles.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
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# Author: Anna BOBASHEVA, University Cote d'Azur, Inria
#
# Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
#
# Annotate text with DBPedia and Wikidata entities
# ISSA environment definitions
. ../env.sh
echo "Working on ${LATEST_UPDATE_DIR}"
source ${ISSA_VENV}/bin/activate
pushd ./ner
echo "************************************************************************"
echo "Annotate with DBPedia Spotlight..."
echo "************************************************************************"
for lang in $SPOTLIGHT_LANGUAGES; do
echo "Starting dbpedia-spotlight.${lang}..."
docker start dbpedia-spotlight.$lang
done
echo "Waiting for models to load (~2 min) ..."
sleep 2m
echo "Started dbpedia-spotlight.$SPOTLIGHT_LANGUAGES"
python3 ./annotation_dbpedia.py $ISSA_PIPELINE_CONFIG
for lang in $SPOTLIGHT_LANGUAGES; do
echo "Stopping dbpedia-spotlight.${lang}"
docker stop dbpedia-spotlight.$lang
done
echo "************************************************************************"
echo "Annotate with Wikidata Entity-Fishing..."
echo "************************************************************************"
echo "Starting entity-fishing..."
docker start entity-fishing
echo "Waiting for models to load (~1 min)..."
sleep 1m
echo "Started entity-fishing..."
python3 ./annotation_wikidata.py $ISSA_PIPELINE_CONFIG
echo "************************************************************************"
echo "Annotate with GeoNames by Entity-Fishing..."
echo "************************************************************************"
python3 ./annotation_geonames.py $ISSA_PIPELINE_CONFIG
echo "Stopping entity-fishing..."
docker stop entity-fishing
echo "************************************************************************"
echo "Annotate with a custom dictionary and Pyclinrec..."
echo "************************************************************************"
echo "Starting pyclinrec..."
docker start pyclinrec
echo "Waiting for recognizers to load (~1 min)..."
sleep 1m
echo "Started pyclinrec..."
python3 ./annotation_pyclinrec.py $ISSA_PIPELINE_CONFIG
docker stop pyclinrec
echo "************************************************************************"
echo "Detect overlapping named entities..."
echo "************************************************************************"
python3 ./overlap_detection.py $ISSA_PIPELINE_CONFIG
popd
deactivate