true, but you are not follow architecture instructions to use atleast one hidden dense layer and then if your want to play with architecture.
Anyways, your preprocess dataset codes are incorrect as well as train_val requires correction.
While slicing dataset, remember the column are index as 0,1, 2 and not 1, 2, 3
so for text, it is on second column [:, 1] and labels is on first column[:, 0]
You also have included index value to the train text and train labels while splitting the dataset, which was not required.
For preprocess dataset, you were suppose to use only previously recalled functions with their respective text and label. You have used incorrect recall function for text
The two arguments to use for text and label are
text_vectorizer (tf.keras.layers.TextVectorization ): text vectorizer
label_encoder (tf.keras.layers.StringLookup): label encoder
no squeezer required.