-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathpos.sh
37 lines (36 loc) · 1.55 KB
/
pos.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
#!/usr/bin/env bash
dir="embedding"
if [ ! -d "$dir" ]; then
mkdir "embedding"
fi
file="embedding/vectors.npy"
if [ -f "$file" ]; then
echo "$file found."
else
url="https://drive.google.com/uc?export=download&id=0BytHkPDTyLo9WU93NEI1bGhmYmc"
wget --load-cookie cookie.txt --save-cookie cookie.txt "${url}" -O tmp
c=`grep -o "confirm=...." tmp`
wget --load-cookie cookie.txt --save-cookie cookie.txt "${url}&$c" -O "${file}"
rm cookie.txt tmp
fi
file="embedding/words.pl"
if [ -f "$file" ]; then
echo "$file found."
else
url="https://drive.google.com/uc?export=download&id=0BytHkPDTyLo9SC1mRXpkbWhfUDA"
wget --load-cookie cookie.txt --save-cookie cookie.txt "${url}" -O tmp
c=`grep -o "confirm=...." tmp`
wget --load-cookie cookie.txt --save-cookie cookie.txt "${url}&$c" -O "${file}"
rm cookie.txt tmp
fi
file="embedding/unknown.npy"
if [ -f "$file" ]; then
echo "$file found."
else
url="https://drive.google.com/uc?export=download&id=0BytHkPDTyLo9VVlld1VlVVVoSHM"
wget --load-cookie cookie.txt --save-cookie cookie.txt "${url}" -O tmp
c=`grep -o "confirm=...." tmp`
wget --load-cookie cookie.txt --save-cookie cookie.txt "${url}&$c" -O "${file}"
rm cookie.txt tmp
fi
python pos.py --train_dir "data/pos/pos_train.txt" --dev_dir "data/pos/pos_dev.txt" --test_dir "data/pos/pos_test.txt" --word_dir "embedding/vectors.npy" --vector_dir "embedding/words.pl" --char_embedd_dim 30 --num_units 300 --num_filters 30 --dropout --grad_clipping 5.0 --peepholes --batch_size 10 --learning_rate 0.01 --decay_rate 0.05 --patience 5