Exercise

TED talk recommender

In this exercise, we will build a recommendation system that suggests TED Talks based on their transcripts. You have been given a get_recommendations() function that takes in the title of a talk, a similarity matrix and an indices series as its arguments, and outputs a list of most similar talks. indices has already been provided to you.

You have also been given a transcripts series that contains the transcripts of around 500 TED talks. Your task is to generate a cosine similarity matrix for the tf-idf vectors of the talk transcripts.

Consequently, we will generate recommendations for a talk titled '5 ways to kill your dreams' by Brazilian entrepreneur Bel Pesce.

Instructions

100 XP
  • Initialize a TfidfVectorizer with English stopwords. Name it tfidf.
  • Construct tfidf_matrix by fitting and transforming transcripts.
  • Generate the cosine similarity matrix cosine_sim using tfidf_matrix.
  • Use get_recommendations() to generate recommendations for '5 ways to kill your dreams'.