Download spam dataset into the ./datasets/ folder

main
Aurélien Geron 2022-02-21 15:03:05 +13:00
parent f9d581b646
commit 060420e1ac
1 changed files with 13 additions and 3 deletions

View File

@ -3510,10 +3510,19 @@
"execution_count": 126, "execution_count": 126,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Downloading data from https://ai.stanford.edu/~amaas/data/sentiment/aclImdb_v1.tar.gz\n",
"84131840/84125825 [==============================] - 27s 0us/step\n",
"84140032/84125825 [==============================] - 27s 0us/step\n"
]
},
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"PosixPath('/Users/ageron/.keras/datasets/aclImdb')" "PosixPath('datasets/aclImdb')"
] ]
}, },
"execution_count": 126, "execution_count": 126,
@ -3526,7 +3535,8 @@
"\n", "\n",
"root = \"https://ai.stanford.edu/~amaas/data/sentiment/\"\n", "root = \"https://ai.stanford.edu/~amaas/data/sentiment/\"\n",
"filename = \"aclImdb_v1.tar.gz\"\n", "filename = \"aclImdb_v1.tar.gz\"\n",
"filepath = tf.keras.utils.get_file(filename, root + filename, extract=True)\n", "filepath = tf.keras.utils.get_file(filename, root + filename, extract=True,\n",
" cache_dir=\".\")\n",
"path = Path(filepath).with_name(\"aclImdb\")\n", "path = Path(filepath).with_name(\"aclImdb\")\n",
"path" "path"
] ]
@ -3570,7 +3580,7 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"/Users/ageron/.keras/datasets/aclImdb/\n", "datasets/aclImdb/\n",
" test/\n", " test/\n",
" neg/\n", " neg/\n",
" 0_2.txt\n", " 0_2.txt\n",