Skip to content

Commit 9278d5a

Browse files
Update text_classification.ipynb
Removed 'from tensorflow.keras import preprocessing' Changed 'tf.keras.preprocessing.text_dataset_from_directory' with 'tf.keras.utils.text_dataset_from_directory' at 3 places (raw_train_ds, raw_val_ds and raw_test_ds) in Download and explore the dataset section. Changed 'preprocessing.TextVectorization' with 'tf.keras.layers.TextVectorization' at Load the dataset section
1 parent fa3b414 commit 9278d5a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

site/en/tutorials/keras/text_classification.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"\n",
121121
"from tensorflow.keras import layers\n",
122122
"from tensorflow.keras import losses\n",
123-
"from tensorflow.keras import preprocessing"
123+
124124
]
125125
},
126126
{
@@ -286,7 +286,7 @@
286286
"batch_size = 32\n",
287287
"seed = 42\n",
288288
"\n",
289-
"raw_train_ds = tf.keras.preprocessing.text_dataset_from_directory(\n",
289+
"raw_train_ds = tf.keras.utils.text_dataset_from_directory(\n",
290290
" 'aclImdb/train', \n",
291291
" batch_size=batch_size, \n",
292292
" validation_split=0.2, \n",
@@ -366,7 +366,7 @@
366366
},
367367
"outputs": [],
368368
"source": [
369-
"raw_val_ds = tf.keras.preprocessing.text_dataset_from_directory(\n",
369+
"raw_val_ds = tf.keras.utils.text_dataset_from_directory(\n",
370370
" 'aclImdb/train', \n",
371371
" batch_size=batch_size, \n",
372372
" validation_split=0.2, \n",
@@ -382,7 +382,7 @@
382382
},
383383
"outputs": [],
384384
"source": [
385-
"raw_test_ds = tf.keras.preprocessing.text_dataset_from_directory(\n",
385+
"raw_test_ds = tf.keras.utils.text_dataset_from_directory(\n",
386386
" 'aclImdb/test', \n",
387387
" batch_size=batch_size)"
388388
]

0 commit comments

Comments
 (0)