1. Learn
  2. /
  3. Courses
  4. /
  5. Natural Language Processing (NLP) in Python

Connected

Exercise

Comparing BoW and TF-IDF representations

You're part of the analytics team at a wearable tech company. Your goal is to help product managers understand customer feedback on the company's new smartwatch. You've already preprocessed the text and created two representations: bow_matrix using CountVectorizer(), and tfidf_matrix using TfidfVectorizer(). In this exercise, you'll visualize and compare the two to better understand how each captures word importance.

Instructions 1/2

undefined XP
  • 1
    • Create a DataFrame using the provided bow_matrix, and plot a heatmap to visualize word frequencies for each review.
  • 2
    • Create a DataFrame from the tfidf_matrix, and plot a heatmap to visualize the TF-IDF scores.