-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgenerate_everything.sh
66 lines (60 loc) · 1.85 KB
/
generate_everything.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
#!/bin/bash
ALCHEMY_CHUNK_SIZE=25000
for file in raw-texts/*; do
echo Processing $file...
echo Harvesting AlchemyAPI...
php HarvestAlchemyApi.php $file $ALCHEMY_CHUNK_SIZE
echo Harvesting Spotlight...
php HarvestSpotlight.php $file
echo Harvesting TextRazor...
php HarvestTextRazor.php $file
done
echo Creating CSV summaries of AlchemyAPI entities...
for file in raw-texts/*; do
base=`basename $file`
files=""
for name in alchemyapi-out/entities*${base}; do
files="$files $name"
done
php AlchemyApiEntitiesToCsv.php $files
done
for file in alchemyapi-out/entities*.csv; do
php AlchemyApiEntitySummarizer.php $file
done
echo Creating CSV summaries of Spotlight entities...
for file in raw-texts/*; do
base=`basename $file`
files=""
for name in spotlight-out/${base/.txt/*.json}; do
files="$files $name"
done
php SpotlightEntitiesToCsv.php $files
php SpotlightEntitySummarizer.php spotlight-out/${base/.txt/.csv}
done
echo Creating CSV summaries of TextRazor entities and topics...
for file in raw-texts/*; do
base=`basename $file`
files=""
for name in textrazor-out/entities*${base}; do
files="$files $name"
done
php TextRazorEntitiesToCsv.php $files
files=""
for name in textrazor-out/topics*${base}; do
files="$files $name"
done
php TextRazorTopicsToCsv.php $files
done
for file in textrazor-out/entities*.csv; do
php TextRazorEntitySummarizer.php $file
done
echo Merging entity files together...
if [ ! -d combined-out ]; then
mkdir combined-out
fi
for file in raw-texts/*; do
base=`basename $file`
suffix=${base/.txt/.csv}
echo "-- *$suffix --"
php CombineEntities.php alchemyapi-out/entities-0-$suffix spotlight-out/summary-$suffix textrazor-out/summary-entities-$suffix combined-out/merged-entities-$suffix
done