Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,13 +54,16 @@ def recommend_movies(movie):
|
|
54 |
recommendations = get_recommendations(movie)
|
55 |
|
56 |
format_string = "{:>5.2f} {:<20}"
|
57 |
-
return "Score
|
58 |
|
59 |
# Create the Gradio interface
|
60 |
movie_list = movies['title'].tolist()
|
61 |
total_movies = len(movies)
|
62 |
-
|
63 |
-
|
|
|
|
|
|
|
64 |
|
65 |
# Launch the app
|
66 |
iface.launch()
|
|
|
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 |
+
iface = gr.Interface(fn=recommend_movies,
|
63 |
+
inputs=gr.Dropdown(movie_list, label=f"Select a Movie (Total movies: {total_movies})"),
|
64 |
+
outputs="text",
|
65 |
+
title="Movie Recommender - Content-Based Filtering",
|
66 |
+
description="Select a movie to get recommendations based on content filtering.")
|
67 |
|
68 |
# Launch the app
|
69 |
iface.launch()
|