-
Notifications
You must be signed in to change notification settings - Fork 624
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for demo word accuracy script, however the utility is set faul…
…ting atm
- Loading branch information
Showing
2 changed files
with
42 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
make | ||
if [ ! -e text8 ]; then | ||
wget http://mattmahoney.net/dc/text8.zip -O text8.gz | ||
gzip -d text8.gz -f | ||
DATA_DIR=../data | ||
BIN_DIR=../bin | ||
|
||
TEXT_DATA=$DATA_DIR/text8 | ||
VECTOR_DATA=$DATA_DIR/text8-vector.bin | ||
|
||
pushd ${BIN_DIR} && make; popd | ||
|
||
|
||
if [ ! -e $VECTOR_DATA ]; then | ||
|
||
if [ ! -e $TEXT_DATA ]; then | ||
wget http://mattmahoney.net/dc/text8.zip -O $DATA_DIR/text8.gz | ||
gzip -d $DATA_DIR/text8.gz -f | ||
fi | ||
echo ----------------------------------------------------------------------------------------------------- | ||
echo -- Training vectors... | ||
time $BIN_DIR/word2vec -train $TEXT_DATA -output $VECTOR_DATA -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1 | ||
|
||
fi | ||
time ./word2vec -train text8 -output vectors.bin -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1 | ||
./compute-accuracy vectors.bin 30000 < questions-words.txt | ||
# to compute accuracy with the full vocabulary, use: ./compute-accuracy vectors.bin < questions-words.txt | ||
|
||
echo ----------------------------------------------------------------------------------------------------- | ||
echo -- distance... | ||
|
||
# to compute accuracy with the full vocabulary, use: compute-accuracy $VECTOR_DATA < $DATA_DIR/questions-words.txt | ||
set -x | ||
$BIN_DIR/compute-accuracy $VECTOR_DATA 30000 < $DATA_DIR/questions-words.txt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
DATA_DIR=../data | ||
BIN_DIR=../src | ||
|
||
TEXT_DATA=$DATA_DIR/text8 | ||
VECTOR_DATA=$DATA_DIR/text8-vector.bin | ||
|
||
pushd ${BIN_DIR} && make; popd | ||
|
||
if [ ! -e $DATA_DIR/text8 ]; then | ||
wget http://mattmahoney.net/dc/text8.zip -O $DATA_DIR/text8.gz | ||
gzip -d $DATA_DIR/text8.gz -f | ||
|
||
if [ ! -e $VECTOR_DATA ]; then | ||
|
||
if [ ! -e $TEXT_DATA ]; then | ||
wget http://mattmahoney.net/dc/text8.zip -O $DATA_DIR/text8.gz | ||
gzip -d $DATA_DIR/text8.gz -f | ||
fi | ||
echo ----------------------------------------------------------------------------------------------------- | ||
echo -- Training vectors... | ||
time $BIN_DIR/word2vec -train $TEXT_DATA -output $VECTOR_DATA -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1 | ||
|
||
fi | ||
|
||
echo ----------------------------------------------------------------------------------------------------- | ||
echo -- Training vectors... | ||
time $BIN_DIR/word2vec -train $DATA_DIR/text8 -output $DATA_DIR/text8-vector.bin -cbow 0 -size 200 -window 5 -negative 0 -hs 1 -sample 1e-3 -threads 12 -binary 1 | ||
|
||
echo ----------------------------------------------------------------------------------------------------- | ||
echo -- distance... | ||
|
||
$BIN_DIR/distance $DATA_DIR/text8-vector.bin | ||
$BIN_DIR/distance $DATA_DIR/$VECTOR_DATA |