From the course: Deep Learning with Python and Keras: Build a Model for Sentiment Analysis

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Representing text using count vectorization

Representing text using count vectorization

- [Instructor] In this movie, we'll see how we can perform text vectorization in inter flow. This is the process of converting our text data into numerical vectors or arrays of numbers, which will allow machine learning models to work with and analyze text. Text vectorization is performed using a keras layer. We'll first vectorize text using the count vectorizer. Before we apply the count vectorizer, on our financial sentiment data, let's understand how it works on a small sample data set. Now I've chosen the vocabulary size to be small, just 30, so the length of the vector generated for each document or each bit of text will be of size 30. I instantiate the count vectorizer using the text vectorization class. Text vectorization is a tensor flow pre-processing layer, which maps text features to integer sequences. The text vectorization layer performs the following steps. It'll first standardize each example using the…

Contents