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 TF-IDF vectorization
From the course: Deep Learning with Python and Keras: Build a Model for Sentiment Analysis
Representing text using TF-IDF vectorization
- [Instructor] Now so far, we've trained a dense neural network by encoding our input text data using a count vectorizer. What I'm going to do now is train the same dense neural network, but we'll use a different encoding for our data. We'll use a TfidfVectorizer. TF-IDF stands for Term Frequency Inverse Document Frequency, and in this vectorization, we continue to use feature vectors the size of our vocabulary to represent text, except that every token in the input text is represented using a TF-IDF score. The term frequency component of the score upways words that occur more frequently in the input text. More frequently occurring words are considered more important. The IDF term downways words that occur more frequently across the entire corpus of documents. The assumption is that more frequently occurring words are common words with less information content. Let's see how we can use the same text vectorizer to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Feed forward neural networks4m 31s
-
(Locked)
Splitting data into training test and validation sets5m 3s
-
(Locked)
Representing text using count vectorization8m 32s
-
(Locked)
Configuring the dense neural network6m 11s
-
(Locked)
Training and evaluating the DNN3m 12s
-
(Locked)
Configuring the count vectorizer as a model layer2m 52s
-
(Locked)
Representing text using TF-IDF vectorization5m 9s
-
(Locked)
Training and evaluating the model3m 19s
-
(Locked)
Representing text using integer sequences3m 58s
-
(Locked)
Training a DNN using embeddings7m 21s
-
(Locked)
-
-