Skip to content

Commit

Permalink
Updated link to GloVe vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kai Sheng Tai committed Dec 17, 2015
1 parent 7b97bf1 commit 5e90d62
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ predictions
trained_models
*~
#*#
*.class
lib/stanford-parser
lib/stanford-tagger

1 change: 1 addition & 0 deletions fetch_and_preprocess.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e
python2.7 scripts/download.py

CLASSPATH="lib:lib/stanford-parser/stanford-parser.jar:lib/stanford-parser/stanford-parser-3.5.1-models.jar"
Expand Down
11 changes: 3 additions & 8 deletions scripts/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def download(url, dirpath):
return filepath

def unzip(filepath):
print("Extracting: " + filepath)
dirpath = os.path.dirname(filepath)
with zipfile.ZipFile(filepath) as zf:
zf.extractall(dirpath)
Expand Down Expand Up @@ -83,14 +84,8 @@ def download_wordvecs(dirpath):
return
else:
os.makedirs(dirpath)
url = 'http://www-nlp.stanford.edu/data/glove.840B.300d.txt.gz'
filepath = download(url, dirpath)
print('extracting ' + filepath)
with gzip.open(filepath, 'rb') as gf:
with open(filepath[:-3], 'w') as f:
for line in gf:
f.write(line)
os.remove(filepath)
url = 'http://www-nlp.stanford.edu/data/glove.840B.300d.zip'
unzip(download(url, dirpath))

def download_sick(dirpath):
if os.path.exists(dirpath):
Expand Down

0 comments on commit 5e90d62

Please sign in to comment.