Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -223,10 +223,11 @@ total_movies = len(movies)
|
|
223 |
with gr.Blocks() as iface:
|
224 |
with gr.Tab("Content-Based Filtering"):
|
225 |
gr.Markdown("""## Movie Recommender - Content-Based Filtering
|
|
|
226 |
* Use the 'genres' feature of movies, and convert genres into numerical vectors.
|
227 |
* For a given movie, find the most similar movies based on the genre similarity.
|
228 |
* This approach uses genres of movies only, without considering user preferences or viewing history.
|
229 |
-
* Simple to implement and computationally efficient
|
230 |
""")
|
231 |
gr.Interface(fn=recommend_movies_cb,
|
232 |
inputs=gr.Dropdown(movie_list, label=f"Select a Movie (Total movies: {total_movies}, randomly list {input_count} for demo purpose.)"),
|
@@ -236,6 +237,7 @@ with gr.Blocks() as iface:
|
|
236 |
|
237 |
with gr.Tab("Collaborative Filtering"):
|
238 |
gr.Markdown("""## Movie Recommender - Item-Based Collaborative Filtering
|
|
|
239 |
* Create a movie-user matrix where rows represent movies and columns represent users, each cell contains the rating a user gave to a movie, or 0 if no rating exists.
|
240 |
* Calculate the cosine similarity between movies based on their rating patterns, results in a movie-movie similarity matrix.
|
241 |
* For a given movie, find the most similar movies based on this similarity matrix, and recommend these movies.
|
@@ -249,6 +251,7 @@ with gr.Blocks() as iface:
|
|
249 |
|
250 |
with gr.Tab("Collaborative Filtering with Neural Network"):
|
251 |
gr.Markdown("""## Movie Recommender - Item-Based Collaborative Filtering with Neural Network
|
|
|
252 |
* Use a Neural Network to predict the missing values in the movie-user matrix to improve the collaborative filtering recommendations.
|
253 |
* The NN model learns to reconstruct the movie-user matrix, effectively predicting missing ratings. This results in a dense, predicted movie-user matrix.
|
254 |
* Calculate movie-movie similarities using the predicted matrix. And use this similarity matrix to find and recommend similar movies.
|
|
|
223 |
with gr.Blocks() as iface:
|
224 |
with gr.Tab("Content-Based Filtering"):
|
225 |
gr.Markdown("""## Movie Recommender - Content-Based Filtering
|
226 |
+
How it works:
|
227 |
* Use the 'genres' feature of movies, and convert genres into numerical vectors.
|
228 |
* For a given movie, find the most similar movies based on the genre similarity.
|
229 |
* This approach uses genres of movies only, without considering user preferences or viewing history.
|
230 |
+
* Simple to implement and computationally efficient.
|
231 |
""")
|
232 |
gr.Interface(fn=recommend_movies_cb,
|
233 |
inputs=gr.Dropdown(movie_list, label=f"Select a Movie (Total movies: {total_movies}, randomly list {input_count} for demo purpose.)"),
|
|
|
237 |
|
238 |
with gr.Tab("Collaborative Filtering"):
|
239 |
gr.Markdown("""## Movie Recommender - Item-Based Collaborative Filtering
|
240 |
+
How it works:
|
241 |
* Create a movie-user matrix where rows represent movies and columns represent users, each cell contains the rating a user gave to a movie, or 0 if no rating exists.
|
242 |
* Calculate the cosine similarity between movies based on their rating patterns, results in a movie-movie similarity matrix.
|
243 |
* For a given movie, find the most similar movies based on this similarity matrix, and recommend these movies.
|
|
|
251 |
|
252 |
with gr.Tab("Collaborative Filtering with Neural Network"):
|
253 |
gr.Markdown("""## Movie Recommender - Item-Based Collaborative Filtering with Neural Network
|
254 |
+
How it works:
|
255 |
* Use a Neural Network to predict the missing values in the movie-user matrix to improve the collaborative filtering recommendations.
|
256 |
* The NN model learns to reconstruct the movie-user matrix, effectively predicting missing ratings. This results in a dense, predicted movie-user matrix.
|
257 |
* Calculate movie-movie similarities using the predicted matrix. And use this similarity matrix to find and recommend similar movies.
|