Bird
0
0

How can you combine an LSTM layer with a convolutional layer to improve text classification performance?

hard📝 Application Q9 of 15
NLP - Sequence Models for NLP
How can you combine an LSTM layer with a convolutional layer to improve text classification performance?
AUse LSTM output as input to convolutional layer
BReplace LSTM with convolutional layers entirely
CApply 1D convolution on embedded sequences before feeding to LSTM
DUse convolutional layers only after the Dense output layer
Step-by-Step Solution
Solution:
  1. Step 1: Understand CNN and LSTM roles

    Convolutional layers extract local features; LSTM captures sequence dependencies.
  2. Step 2: Combine layers effectively

    Applying 1D convolution on embeddings first extracts features, then LSTM models sequence relations.
  3. Final Answer:

    Apply 1D convolution on embedded sequences before feeding to LSTM -> Option C
  4. Quick Check:

    Conv1D before LSTM improves feature extraction [OK]
Quick Trick: Use Conv1D before LSTM for better text features [OK]
Common Mistakes:
MISTAKES
  • Feeding LSTM output to convolution
  • Replacing LSTM entirely with CNN
  • Placing convolution after Dense layer

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NLP Quizzes