forked from tmikolov/word2vec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uridemo-multi2.sh
executable file
·77 lines (64 loc) · 1.79 KB
/
uridemo-multi2.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
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
if [ $# -lt 2 ]
then
#echo "Usage: uridemo.sh <length> <width>"
#exit 1
length=4
width=1
else
length=$1
width=$2
fi
DATA_DIR=data
BIN_DIR=bin
SRC_DIR=src
CBOW=0
NEG=5
HS=0
SAMPLE=0
MIN_COUNT=100
PATHS_MIN_COUNT=100
ITER=5
DESC=js${length}x${width}_cbow${CBOW}_hs${HS}_neg${NEG}_sample${SAMPLE}_mincount${MIN_COUNT}_pathsmincount${PATHS_MIN_COUNT}_iter${ITER}
MODEL=js_cbow${CBOW}_hs${HS}_iter${ITER}_min${MIN_COUNT}_shuffled
TEXT_DATA=../UnuglifyJS/glove_models/js${length}x${width}-shuffled.txt
VOCAB_FILE=models/$MODEL/vocab.txt
VECTOR_DATA=models/$MODEL/vectors.bin
if [ ! -d "models" ]; then
mkdir models
fi
cd models
if [ ! -d "$MODEL" ]; then
mkdir $MODEL
cd $MODEL
echo $DESC > description.txt
cd ..
fi
cd ..
pushd ${SRC_DIR} && make; popd
time $BIN_DIR/word2vec -train $TEXT_DATA -output $VECTOR_DATA -cbow $CBOW -size 150 -window 1 -negative $NEG -hs $HS -sample $SAMPLE -threads 64 -binary 1 -min-count $MIN_COUNT -save-vocab $VOCAB_FILE
CBOW=0
NEG=5
HS=1
SAMPLE=0
MIN_COUNT=100
PATHS_MIN_COUNT=100
ITER=5
DESC=js${length}x${width}_cbow${CBOW}_hs${HS}_neg${NEG}_sample${SAMPLE}_mincount${MIN_COUNT}_pathsmincount${PATHS_MIN_COUNT}_iter${ITER}
MODEL=js_cbow${CBOW}_hs${HS}_iter${ITER}_min${MIN_COUNT}_shuffled
TEXT_DATA=../UnuglifyJS/glove_models/js${length}x${width}-shuffled.txt
VOCAB_FILE=models/$MODEL/vocab.txt
VECTOR_DATA=models/$MODEL/vectors.bin
if [ ! -d "models" ]; then
mkdir models
fi
cd models
if [ ! -d "$MODEL" ]; then
mkdir $MODEL
cd $MODEL
echo $DESC > description.txt
cd ..
fi
cd ..
pushd ${SRC_DIR} && make; popd
time $BIN_DIR/word2vec -train $TEXT_DATA -output $VECTOR_DATA -cbow $CBOW -size 150 -window 1 -negative $NEG -hs $HS -sample $SAMPLE -threads 64 -binary 1 -min-count $MIN_COUNT -save-vocab $VOCAB_FILE