Complete the code to import TensorFlow's text processing module.
import tensorflow as tf from tensorflow import [1]
TensorFlow has a dedicated text module for handling text data efficiently.
Complete the code to create a tokenizer that splits sentences into words.
tokenizer = tf.keras.preprocessing.text.[1]()The Tokenizer class in TensorFlow helps split text into tokens (words).
Fix the error in the code to convert text to sequences of integers.
tokenizer = tf.keras.preprocessing.text.Tokenizer()
tokenizer.fit_on_texts(texts)
sequences = tokenizer.[1](texts)The correct method to convert texts to sequences is texts_to_sequences.
Fill both blanks to create a dictionary of word counts for words longer than 3 letters.
word_counts = {word: [1] for word in words if len(word) [2] 3}We count how many times each word appears using words.count(word) and filter words longer than 3 letters with len(word) > 3.
Fill all three blanks to create a dictionary of uppercase words and their counts for words longer than 4 letters.
result = { [1]: [2] for w in words if len(w) [3] 4 }The dictionary keys are uppercase words w.upper(), values are counts words.count(w), and we filter words longer than 4 letters with len(w) > 4.
