Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -118,7 +118,7 @@ def get_cf_recommendations(movie_title, movie_similarity_df=movie_similarity_df,
|
|
118 |
|
119 |
# Function for Gradio interface
|
120 |
def recommend_movies_cf(movie_title):
|
121 |
-
if not
|
122 |
return "No movie selected. Please select one from the dropdown."
|
123 |
|
124 |
if movie_title not in movies['title'].values:
|
@@ -128,6 +128,7 @@ def recommend_movies_cf(movie_title):
|
|
128 |
format_string = "{:>5.2f} {:<20}"
|
129 |
return "Score Title\n" + "\n".join([format_string.format(score, title) for title, score in recommendations])
|
130 |
|
|
|
131 |
######################################
|
132 |
#
|
133 |
# Collaborative Filtering with Neural Network (Item-based)
|
@@ -201,7 +202,7 @@ def get_cfnn_recommendations(movie_title, movie_similarity_df=movie_similarity_c
|
|
201 |
|
202 |
# Function for Gradio interface
|
203 |
def recommend_movies_cfnn(movie_title):
|
204 |
-
if not
|
205 |
return "No movie selected. Please select one from the dropdown."
|
206 |
|
207 |
if movie_title not in movies['title'].values:
|
|
|
118 |
|
119 |
# Function for Gradio interface
|
120 |
def recommend_movies_cf(movie_title):
|
121 |
+
if not movie_title:
|
122 |
return "No movie selected. Please select one from the dropdown."
|
123 |
|
124 |
if movie_title not in movies['title'].values:
|
|
|
128 |
format_string = "{:>5.2f} {:<20}"
|
129 |
return "Score Title\n" + "\n".join([format_string.format(score, title) for title, score in recommendations])
|
130 |
|
131 |
+
|
132 |
######################################
|
133 |
#
|
134 |
# Collaborative Filtering with Neural Network (Item-based)
|
|
|
202 |
|
203 |
# Function for Gradio interface
|
204 |
def recommend_movies_cfnn(movie_title):
|
205 |
+
if not movie_title:
|
206 |
return "No movie selected. Please select one from the dropdown."
|
207 |
|
208 |
if movie_title not in movies['title'].values:
|