Complete the code to import the LSTM layer from Keras.
from tensorflow.keras.layers import [1]
The LSTM layer is imported from tensorflow.keras.layers as LSTM.
Complete the code to add an LSTM layer with 50 units to the model.
model.add(LSTM([1]))The LSTM layer is created with 50 units to capture sequence features.
Fix the error in the code to compile the model with categorical crossentropy loss.
model.compile(optimizer='adam', loss='[1]', metrics=['accuracy'])
For multi-class text classification, categorical_crossentropy is the correct loss function.
Fill both blanks to create a dictionary comprehension that maps words to their lengths only if length is greater than 3.
{word: [1] for word in words if len(word) [2] 3}The dictionary comprehension maps each word to its length if the length is greater than 3.
Fill all three blanks to create a dictionary comprehension that maps uppercase words to their counts if count is greater than 0.
{ [1]: [2] for [3], count in word_counts.items() if count > 0 }The comprehension maps each word in uppercase to its count, filtering counts greater than zero.