Project Creation: Part Two
Explore the process of building an RNN model for sentiment analysis on IMDB reviews. This lesson guides you through defining model architecture with embedding and RNN layers, compiling with appropriate loss functions and optimizers, and preparing data for model training. Gain practical skills to implement binary text classification using deep learning.
We'll cover the following...
We'll cover the following...
Create the model architecture
Now that we have our input in the format that our model will accept, we can create the model architecture. In this project, we are going to use a simple RNN model. But don’t worry, in later chapters, we will work with LSTMs too.
Let’s create the model architecture.
Explanation:
- On line 1 and line 2, we imported the package that is required for our model architecture.
- On line 4, we created an object of sequential class. A sequential model is used for a plain stack of layers, where each layer has exactly one input tensor and one output tensor.
- On line 5, we added the embedding layer with the appropriate parameters. Note that you must not change the value of
10,000, as this was the vocabulary size we