In the book “Deep Learning with Python, Second Edition”, the author uses the TextVectorization
class to preprocess text into sequences as such:
max_length = 600
max_tokens = 20000
text_vectorization = TextVectorization(
max_tokens=max_tokens,
output_mode="int",
output_sequence_length=max_length,
)
where each is integer encoded like [5, 18, 1, 0, 53,...]
and so each batch is of shape [batch_size, 600]
. However when building the model he doesn’t specify the input shape: inputs = keras.Input(shape=(None,), dtype="int64")
. Any idea why that is?