forked from tmikolov/word2vec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uridemo-multi.sh
executable file
·65 lines (58 loc) · 2.13 KB
/
uridemo-multi.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
#!/bin/bash
if [ $# -lt 2 ]
then
echo "Usage: uridemo.sh <length> <width>"
exit 1
fi
length=$1
width=$2
DATA_DIR=data
BIN_DIR=bin
SRC_DIR=src
MODEL=jsnice_training_clean${length}x${width}
TEXT_DATA=../UnuglifyJS/glove_models/$MODEL.txt
VOCAB_FILE=models/$MODEL/vocab.txt
VECTOR_DATA=models/$MODEL/vectors.bin
if [ ! -d "models" ]; then
mkdir models
fi
pushd ${SRC_DIR} && make; popd
MODEL=jsnice_training_clean${length}x${width}xcbow0hs0
VECTOR_DATA=models/$MODEL/vectors.bin
cd models
if [ ! -d "$MODEL" ]; then
mkdir $MODEL
cp jsnice_training_clean4x1/vocab.txt $MODEL
fi
cd ..
time $BIN_DIR/word2vec -train $TEXT_DATA -output $VECTOR_DATA -cbow 0 -size 150 -window 1 -negative 5 -hs 0 -sample 0 -threads 64 -binary 1 -min-count 200 -paths-min-count 0 -read-vocab $VOCAB_FILE
MODEL=jsnice_training_clean${length}x${width}xcbow1hs0
VECTOR_DATA=models/$MODEL/vectors.bin
cd models
if [ ! -d "$MODEL" ]; then
mkdir $MODEL
cp jsnice_training_clean4x1/vocab.txt $MODEL
fi
cd ..
time $BIN_DIR/word2vec -train $TEXT_DATA -output $VECTOR_DATA -cbow 1 -size 150 -window 1 -negative 5 -hs 0 -sample 0 -threads 64 -binary 1 -min-count 200 -paths-min-count 0 -read-vocab $VOCAB_FILE
MODEL=jsnice_training_clean${length}x${width}xcbow1hs1
VECTOR_DATA=models/$MODEL/vectors.bin
cd models
if [ ! -d "$MODEL" ]; then
mkdir $MODEL
cp jsnice_training_clean4x1/vocab.txt $MODEL
fi
cd ..
time $BIN_DIR/word2vec -train $TEXT_DATA -output $VECTOR_DATA -cbow 1 -size 150 -window 1 -negative 5 -hs 1 -sample 0 -threads 64 -binary 1 -min-count 200 -paths-min-count 0 -read-vocab $VOCAB_FILE
MODEL=jsnice_training_clean${length}x${width}xcbow0hs1_sample
VECTOR_DATA=models/$MODEL/vectors.bin
cd models
if [ ! -d "$MODEL" ]; then
mkdir $MODEL
cp jsnice_training_clean4x1/vocab.txt $MODEL
fi
cd ..
time $BIN_DIR/word2vec -train $TEXT_DATA -output $VECTOR_DATA -cbow 0 -size 150 -window 1 -negative 5 -hs 1 -sample 1e-4 -threads 64 -binary 1 -min-count 200 -paths-min-count 0 -read-vocab $VOCAB_FILE
#echo -----------------------------------------------------------------------------------------------------
#echo -- distance...
#$BIN_DIR/distance $VECTOR_DATA