Last active
April 23, 2024 09:42
-
-
Save yanaiela/cfef50380de8a5bfc8c272bb0c91d6e1 to your computer and use it in GitHub Desktop.
simple bash script for downloading the Google word2vec model (https://code.google.com/archive/p/word2vec/) from Google-Drive
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
#!/bin/bash | |
# usage: | |
# first make the file executable | |
# ./word2vec-download300model.sh output-file | |
OUTPUT=$( wget --save-cookies cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=0B7XkCwpI5KDYNlNUTTlSS21pQmM' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/Code: \1\n/p' ) | |
CODE=${OUTPUT##*Code: } | |
echo $CODE | |
F='GoogleNews-vectors-negative300.bin.gz' | |
if [ -z "$1" ] | |
then | |
OUT_F=$F | |
else | |
OUT_F=$1/$F | |
fi | |
echo $OUT_F | |
wget --load-cookies cookies.txt 'https://docs.google.com/uc?export=download&confirm='$CODE'&id=0B7XkCwpI5KDYNlNUTTlSS21pQmM' -O $OUT_F |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just added it to the file.
./word2vec-download300model.sh output-file