Ted Talks Recommendation System with Machine Learning

Ted talks are a good source to learn and take inspiration from. These days every platform is having a recommendation system to provide a better user experience. Most of the applications collect data to recommend similar content according to the interests of the user. We can use the same strategy to recommend ted talks. So in this article, I will take you through the Ted Talks recommendation system with Machine Learning using Python.

Ted Talks Recommendation System with Machine Learning

Ted Talks Recommendation System has to be purely based on the content rather than based on data of a user. As a user generally watches videos on Youtube and other applications mostly to get entertained. But a user watches Ted Talks to take some inspiration, so the data of the user has nothing to do here.

To recommend Ted Talks to a user we need to create a content-based recommendation system where all the ted talks will be recommended based on the content of the video that the user watched earlier. To create such a system we can use the concept of cosine similarity in machine learning. In the section below, I will take you through how to create a Ted Talks recommendation system with machine learning using Python.

Ted Talks Recommendation System using Python

The dataset that I will be using here to create a Ted Talks recommendation system contains the transcripts of all the audios and videos of Ted talks uploaded at Ted.com. Let’s start the task of creating this recommendation system by importing the necessary Python libraries and the dataset:

                                          transcript                                                url
0  Good morning. How are you?(Laughter)It's been ...  https://www.ted.com/talks/ken_robinson_says_sc...
1  Thank you so much, Chris. And it's truly a gre...  https://www.ted.com/talks/al_gore_on_averting_...
2  (Music: "The Sound of Silence," Simon & Garfun...  https://www.ted.com/talks/david_pogue_says_sim...
3  If you're here today — and I'm very happy that...  https://www.ted.com/talks/majora_carter_s_tale...
4  About 10 years ago, I took on the task to teac...  https://www.ted.com/talks/hans_rosling_shows_t...

The dataset contains the transcript of the ted talks and the URL of that content. So to continue with this dataset, I will create a new column as a title by separating the title from the URL:

data["title"] = data["url"].map(lambda x:x.split("/")[-1])

As I stated in the beginning that this recommender system has to be purely based on the content rather than the data of the user so here I will first prepare this dataset and then let’s use cosine similarity to measure the similarities between different Ted talks:

Now that last step will be to create a Python function to recommend ted talks based on their content. So let’s define a Python function and have a look at some recommendations:

['RORY BREMNER S ONE MAN WORLD SUMMIT', '.ALICE BOWS LARKIN WE RE TOO LATE TO PREVENT CLIMATE CHANGE HERE S HOW WE ADAPT', '.TED HALSTEAD A CLIMATE SOLUTION WHERE ALL SIDES CAN WIN', '.AL GORE S NEW THINKING ON THE CLIMATE CRISIS']

So we can get similar results which means that you can follow the same strategy while creating any type of content recommendation system.

Summary

In this article, I introduced you to how to create a content-based recommender system for recommending ted talks to a user. To find the similarities between different ted talks I used the concept of cosine similarity here. I hope you liked this article on the Ted Talks Recommendation system with machine learning using Python. Feel free to ask your valuable questions in the comments section below.

Aman Kharwal
Aman Kharwal

I'm a writer and data scientist on a mission to educate others about the incredible power of data📈.

Articles: 1501

Leave a Reply