From the course: Deep Learning Foundations: Natural Language Processing with TensorFlow

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Implementing LSTMs with TensorFlow

Implementing LSTMs with TensorFlow - TensorFlow Tutorial

From the course: Deep Learning Foundations: Natural Language Processing with TensorFlow

Start my 1-month free trial

Implementing LSTMs with TensorFlow

- [Instructor] So we have understood the importance of sequence and providing context to classify texts as positive or negative, or you can say sarcastic or non-sarcastic. Now, in this particular video, we are going to implement the LSTM based model to classify our news headlines as sarcastic or not sarcastic. We're using the same dataset that we have used in the previous chapters. So here, first of all, let's import all of the packages that we are going to be using. So when NumPy, TensorFlow, tokenizer, or pad_sequences make sure that you're using TensorFlow 2.x. So we are currently using 2.4.1. So quickly download your data and read it using the pandas package. So again, we have the same dataset headline column and is_sarcastic column is the one that we are interested in, segregate create arrays for both your headlines and your labels. The next part, very important part is defining the parameters for tokenizing…

Contents