Menu

Testing the Recommendation System

Testing the Recommendation System

After building the recommendation function, we can test the system by selecting a news headline from the dataset.

Code

selected_news = news.iloc[0]['headline']
display_recommendations(selected_news)

Explanation

The first news headline in the dataset is selected as the input.

The recommendation system compares it with all other articles and displays the five most similar news headlines.

Output

A list of recommended news articles related to the selected headline is displayed.