def download_glove(glove):
if os.path.exists(glove):
return
print('Downloading glove...')
with tempfile.TemporaryFile() as tmp:
with urllib.request.urlopen('http://nlp.stanford.edu/data/glove.42B.300d.zip') as res:
shutil.copyfileobj(res, tmp)
with zipfile.ZipFile(tmp, 'r') as glove_zip:
glove_zip.extract('glove.42B.300d.txt', path=os.path.dirname(glove))
print('Done')
prepare.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录