8 – 9 DefiningModel V1

By now, you’ve had a lot of practice with data processing and with defining RNNs. So, I’m not going to give you too much guidance here, when it comes to defining this model. Here’s what it should look like generally. The model should be able to take in our word tokens, and the first thing … Read more

7 – 8 TensorDataset Batching V1

In this cell, I’ve split our features and encoded labels into training test and validation sets. I started by splitting our features and label data according to their split frac. So, I’m reserving 80 percent of my data for training and I’m basically getting the index at which I should split my features and label … Read more

6 – 7 PaddedFeatures Sol V1

So here’s my solution for creating an array of features, reviews that have either been padded on the left with zeros until their sequence length on or truncated at that length. First, I’m actually creating an array of zeros, that’s just the final shape that I know I want. That is, it should have as … Read more

4 – 5 GettingRid ZeroLength V1

After encoding all our word and label data as an additional preprocessing step, we want to make sure that our reviews are in good shape for standard processing. That is, our network will expect a standard input text size, and so we’ll want to shape our reviews into a consistent specific length. There are two … Read more

3 – 4 EncodingWords Sol V1

First, here’s how I went about creating a vocab to int dictionary and encoding our word data, and there are a few ways to do this. I chose to use this important counter to create a dictionary that maps the most common words in our reviews text to the smallest integers. So the first thing … Read more

2 – 3 Data PreProcessing V1

So, let’s get started with sentiment analysis. First, I’m going to load in data from our data directory. In here, there are two files reviews.txt and labels.txt. These are just the text files for our movie reviews data and their corresponding labels, positive or negative. So, I’m going to load these in and print out … Read more

1 – 1 SentimentRNN Intro V1

Welcome to this lesson on Sentiment Analysis with an RNN. All right. So, in this notebook, I want to give you one more LSTM example, and in this case, we’ll actually be training an RNN to solve our sentiment analysis task from a few lessons ago. Sentiment analysis is all about taking in some text, … Read more