jchen8000 commited on
Commit
c2e19f2
·
verified ·
1 Parent(s): 993d08d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
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 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
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()