-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·40 lines (31 loc) · 958 Bytes
/
setup.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
#!/usr/bin/bash
set -e
source ./setup_paths.conf
if [ ! -e data ] ; then
mkdir data
fi
if [ ! -e "$DS_ZIP" ] ; then
echo "Download dataset $DATASET"
echo 'For dataset description see https://zenodo.org/records/7029359'
wget --show-progress -O "$DS_ZIP" "https://zenodo.org/records/7029359/files/$DATASET.zip"
fi
if [ ! -e "$DS_GZ" ] ; then
echo 'Extract sql from dataset zip'
unzip "$DS_ZIP" "$DATASET/Data/$DATASET.sql.gz" -d data
fi
if [ ! -e "$DB" ] ; then
echo "Convert dataset to sqlite $DB"
echo "sqlite version: $(sqlite3 -version)"
time gzip -d < "$DS_GZ" | sqlite3 "$DB"
fi
if [ ! -e "$DB" ] ; then
echo "Something went very wrong $DB still doesn't exist"
exit 1
fi
DB_SIZE=$(stat --format='%s' "$DB")
if [ "$DB_SIZE" -gt 4000000000 ] ; then
echo 'Dataset is big, shrink it'
sqlite3 "$DB" < cvm/sql/prepare_db.sql
fi
./w2v-default.sh
echo 'Done. You can run ./cleanup.sh to free some space'