-
Notifications
You must be signed in to change notification settings - Fork 110
/
Copy pathdownload.sh
54 lines (49 loc) · 1.25 KB
/
download.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
#!/usr/bin/env bash
# check if requirements are met
REQUIRED=(
"wget"
"unzip"
"python3"
"pip"
)
for ((i=0;i<${#REQUIRED[@]};++i)); do
if ! [ -x "$(command -v ${REQUIRED[i]})" ]; then
echo 'Error: ${REQUIRED[i]} is not installed.' >&2
exit -1
fi
done
# Download SQuAD & GloVe
SQUAD_DIR=SQuAD
GLOVE_DIR=glove
mkdir -p $SQUAD_DIR
mkdir -p $GLOVE_DIR
URLS=(
"https://rajpurkar.github.io/SQuAD-explorer/dataset/train-v1.1.json"
"https://rajpurkar.github.io/SQuAD-explorer/dataset/dev-v1.1.json"
"http://nlp.stanford.edu/data/glove.840B.300d.zip"
)
FILES=(
"$SQUAD_DIR/train-v1.1.json"
"$SQUAD_DIR/dev-v1.1.json"
"$GLOVE_DIR/glove.840B.300d.zip"
)
for ((i=0;i<${#URLS[@]};++i)); do
file=${FILES[i]}
url=${URLS[i]}
if [ -f $file ]; then
echo "$file already exists, skipping download."
else
wget $url -O $file
if [ -f $file ]; then
echo "$url successfully downloaded."
else
echo "$url not successfully downloaded."
exit -1
fi
if [ ${file: -4} == ".zip" ]; then
unzip $file -d "$(dirname "$file")"
fi
fi
done
# Download SpaCy English language models
python3 -m spacy download en_core_web_md