Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -52,13 +52,9 @@ def get_recommendations(title, cosine_sim=cosine_sim):
|
|
52 |
# Gradio interface
|
53 |
def recommend_movies(movie):
|
54 |
recommendations = get_recommendations(movie)
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
headers = "Score{:10}Title".format("")
|
60 |
-
return headers + "\n" + "\n".join([f"{score:>10.2f} {title:<20} " for title, score in recommendations])
|
61 |
-
|
62 |
|
63 |
# Create the Gradio interface
|
64 |
movie_list = movies['title'].tolist()
|
|
|
52 |
# Gradio interface
|
53 |
def recommend_movies(movie):
|
54 |
recommendations = get_recommendations(movie)
|
55 |
+
|
56 |
+
format_string = "{:>5.2f} {:<20}"
|
57 |
+
return "Score Title\n" + "\n".join([format_string.format(score, title) for title, score in recommendations])
|
|
|
|
|
|
|
|
|
58 |
|
59 |
# Create the Gradio interface
|
60 |
movie_list = movies['title'].tolist()
|