From 483c50ba24ea1a4de0dec1f1b224c1092955f1fa Mon Sep 17 00:00:00 2001 From: Derek Haynes Date: Mon, 30 Mar 2020 14:58:24 -0600 Subject: [PATCH] APIs lesson fixes - use_glove => use-glove, utilities --- notebooks/03_APIs/pt-text-classification/README.md | 2 +- .../03_APIs/pt-text-classification/text_classification/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notebooks/03_APIs/pt-text-classification/README.md b/notebooks/03_APIs/pt-text-classification/README.md index cf4cfad6..0bba4572 100644 --- a/notebooks/03_APIs/pt-text-classification/README.md +++ b/notebooks/03_APIs/pt-text-classification/README.md @@ -17,7 +17,7 @@ python text_classification/utils.py ## Training ```bash python text_classification/train.py \ - --data-url https://raw.githubusercontent.com/madewithml/lessons/master/data/news.csv --lower --shuffle --use_glove + --data-url https://raw.githubusercontent.com/madewithml/lessons/master/data/news.csv --lower --shuffle --use-glove ``` ## Inference diff --git a/notebooks/03_APIs/pt-text-classification/text_classification/utils.py b/notebooks/03_APIs/pt-text-classification/text_classification/utils.py index 15914499..eb31ab9f 100644 --- a/notebooks/03_APIs/pt-text-classification/text_classification/utils.py +++ b/notebooks/03_APIs/pt-text-classification/text_classification/utils.py @@ -87,6 +87,6 @@ def make_embeddings_matrix(embeddings, token_to_index, embedding_dim): # Unzip and write embeddings (may take ~3-5 minutes) resp = urlopen('http://nlp.stanford.edu/data/glove.6B.zip') embeddings_dir = os.path.join(config.BASE_DIR, 'embeddings') - utilities.create_dirs(embeddings_dir) + create_dirs(embeddings_dir) with ZipFile(BytesIO(resp.read()), 'r') as zr: zr.extractall(embeddings_dir)