Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jowagner committed Dec 24, 2015
2 parents 33b0965 + 5e90d62 commit 2a5f625
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 @@ -56,6 +56,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 @@ -95,14 +96,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 2a5f625

Please sign in to comment.