We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3f7572 commit 2d76b3cCopy full SHA for 2d76b3c
examples/nlp/multi_label_classification.py
@@ -30,8 +30,9 @@
30
## Imports
31
"""
32
33
-from tensorflow.keras import layers
34
-from tensorflow import keras
+import keras
+from keras import layers
35
+
36
import tensorflow as tf
37
38
from sklearn.model_selection import train_test_split
@@ -145,7 +146,7 @@
145
146
147
148
terms = tf.ragged.constant(train_df["terms"].values)
-lookup = tf.keras.layers.StringLookup(output_mode="multi_hot")
149
+lookup = layers.StringLookup(output_mode="multi_hot")
150
lookup.adapt(terms)
151
vocab = lookup.get_vocabulary()
152
0 commit comments