jchen8000 commited on
Commit
7dbbd88
·
verified ·
1 Parent(s): e28d195

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -63,11 +63,19 @@ def recommend_movies(movie):
63
  # Create the Gradio interface
64
  movie_list = random.sample(movies['title'].tolist(), input_count)
65
  total_movies = len(movies)
66
- iface = gr.Interface(fn=recommend_movies,
 
 
 
 
67
  inputs=gr.Dropdown(movie_list, label=f"Select a Movie (Total movies: {total_movies}, randomly list {input_count} for demo purpose.)"),
68
  outputs="text",
69
  title="Movie Recommender - Content-Based Filtering",
70
  description="Select a movie to get recommendations based on content filtering.")
71
-
 
 
 
 
72
  # Launch the app
73
  iface.launch()
 
63
  # Create the Gradio interface
64
  movie_list = random.sample(movies['title'].tolist(), input_count)
65
  total_movies = len(movies)
66
+
67
+ with gr.Blocks() as iface:
68
+ with gr.Tab("Content-Based Filtering"):
69
+ gr.Markdown("## Recommendation - Content-Based Filtering")
70
+ gr.Interface(fn=recommend_movies,
71
  inputs=gr.Dropdown(movie_list, label=f"Select a Movie (Total movies: {total_movies}, randomly list {input_count} for demo purpose.)"),
72
  outputs="text",
73
  title="Movie Recommender - Content-Based Filtering",
74
  description="Select a movie to get recommendations based on content filtering.")
75
+
76
+ with gr.Tab("Collaborative Filtering"):
77
+ gr.Markdown("## Recommendation - Collaborative Filtering")
78
+ gr.Markdown("### In construction")
79
+
80
  # Launch the app
81
  iface.launch()