You are tasked with building a model that reads movie reviews and classifies the sentiment as positive or negative. Because textual reviews consist of variable-length sequences of words where context and order are critical, which of the following neural network architectures is most appropriate?
Select an answer to reveal the explanation.
Short Explanation and Infographic
If you want to read a movie review and figure out if the reviewer loved or hated the film, you're dealing with text—which is sequential data. In a sentence like "I didn't enjoy this movie, though the acting was good," the order of those words is everything. A standard feedforward network won't cut it here because it forgets the beginning of the sentence by the time it reaches the end. To solve this, you need a network with a memory. That's exactly what RNNs and LSTMs are built for. They loop information back into themselves, allowing them to keep track of the context as they read through the text. Got it? Let's move on!
Full explanation below image
Full Explanation
Sentiment analysis of text (such as movie reviews) is a classic natural language processing (NLP) problem. Text data is inherently sequential; words are read in order, and their meaning is highly dependent on both preceding and succeeding context.
Recurrent Neural Networks (RNNs) and Long Short-Term Memory (LSTM) networks are specifically designed for sequential data. Unlike standard feedforward networks, they possess recurrent connections that allow information to persist. An LSTM, in particular, uses gates (input, forget, output) to maintain a cell state over long sequences, preventing gradients from vanishing and enabling the model to remember context across many words.
Additionally, modern NLP pipelines also utilize Transformers (like BERT or GPT), which use self-attention mechanisms to model sequence dependencies in parallel. However, within recurrent architectures, LSTMs remain a classic and highly effective choice for capturing temporal dynamics over variable-length text sequences, whereas feedforward networks fail entirely to maintain sequence context.
Let's evaluate the incorrect choices: - Option A (K-Means): K-Means is an unsupervised clustering algorithm. Sentiment analysis is a supervised classification task. K-Means is not a neural network and cannot naturally model sequence patterns or labels. - Option C (Standard feedforward network): A standard feedforward network requires a fixed input size (meaning you would have to pad or truncate reviews heavily and lose sequence context) and lacks recurrent connections, rendering it poor at capturing word order. - Option D (CNN with 3D kernels): While 1D CNNs can sometimes be applied to text to extract local n-gram features, 3D CNNs are specifically designed for video processing or volumetric spatial data (where there are three spatial dimensions plus channels), making them overly complex and inappropriate for text sentiment analysis.