Skip to content

Commit 265f982

Browse files
gustavocidornelaswhoseoyster
authored andcommitted
Completes UNB-2546 - Don't download dataset if it already exists locally
1 parent d755ee6 commit 265f982

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

examples/text-classification/fasttext/fasttext.ipynb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
{
4949
"cell_type": "code",
50-
"execution_count": 3,
50+
"execution_count": 2,
5151
"id": "42de6fd6",
5252
"metadata": {},
5353
"outputs": [],
@@ -66,9 +66,6 @@
6666
"name": "stderr",
6767
"output_type": "stream",
6868
"text": [
69-
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
70-
" Dload Upload Total Spent Left Speed\n",
71-
"100 446k 100 446k 0 0 194k 0 0:00:02 0:00:02 --:--:-- 194k\n",
7269
"x cooking.stackexchange.id\n",
7370
"x cooking.stackexchange.txt\n",
7471
"x readme.txt\n"
@@ -82,7 +79,11 @@
8279
" mkdir ./data\n",
8380
"fi\n",
8481
"\n",
85-
"curl https://dl.fbaipublicfiles.com/fasttext/data/cooking.stackexchange.tar.gz --output data/cooking.stackexchange.tar.gz && tar xvzf data/cooking.stackexchange.tar.gz -C data\n",
82+
"if [ ! -f data/cooking.stackexchange.tar.gz ]; then\n",
83+
" curl https://dl.fbaipublicfiles.com/fasttext/data/cooking.stackexchange.tar.gz --output data/cooking.stackexchange.tar.gz \n",
84+
"fi \n",
85+
"\n",
86+
"tar xvzf data/cooking.stackexchange.tar.gz -C data\n",
8687
"head -n 12404 data/cooking.stackexchange.txt > data/cooking.train\n",
8788
"tail -n 3000 data/cooking.stackexchange.txt > data/cooking.valid"
8889
]
@@ -108,7 +109,7 @@
108109
"Read 0M words\n",
109110
"Number of words: 14543\n",
110111
"Number of labels: 735\n",
111-
"Progress: 100.0% words/sec/thread: 1863090 lr: 0.000000 avg.loss: 5.498450 ETA: 0h 0m 0s\n"
112+
"Progress: 100.0% words/sec/thread: 1836491 lr: 0.000000 avg.loss: 5.229637 ETA: 0h 0m 0s-0.000011 avg.loss: 5.229637 ETA: 0h 0m 0s\n"
112113
]
113114
}
114115
],
@@ -125,7 +126,7 @@
125126
{
126127
"data": {
127128
"text/plain": [
128-
"(3000, 0.49633333333333335, 0.2146461006198645)"
129+
"(3000, 0.5046666666666667, 0.2182499639613666)"
129130
]
130131
},
131132
"execution_count": 6,

0 commit comments

Comments
 (0)