Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -53,11 +53,13 @@ def get_recommendations(title, cosine_sim=cosine_sim):
|
|
53 |
def recommend_movies(movie):
|
54 |
recommendations = get_recommendations(movie)
|
55 |
|
56 |
-
format_string = "{:>5.2f}
|
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()
|
|
|
|
|
61 |
iface = gr.Interface(fn=recommend_movies, inputs=gr.Dropdown(movie_list), outputs="text", title="Movie Recommender - Content-Based Filtering", description="Select a movie to get recommendations based on content filtering.")
|
62 |
|
63 |
# Launch the app
|
|
|
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()
|
61 |
+
total_movies = len(movies)
|
62 |
+
dropdown_label = f"Select a Movie (Total movies: {total_movies})"
|
63 |
iface = gr.Interface(fn=recommend_movies, inputs=gr.Dropdown(movie_list), outputs="text", title="Movie Recommender - Content-Based Filtering", description="Select a movie to get recommendations based on content filtering.")
|
64 |
|
65 |
# Launch the app
|