Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,11 +15,19 @@ def calculate_similarity_matrix(genre_df):
|
|
| 15 |
return similarity_matrix
|
| 16 |
|
| 17 |
similarity_matrix = calculate_similarity_matrix(genre_df)
|
| 18 |
-
|
| 19 |
def random_selection(movies):
|
| 20 |
random_movies = movies['title'].sample(5).to_numpy()
|
| 21 |
return random_movies
|
|
|
|
| 22 |
movie = st.text_input("Search for movie")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
if not movie:
|
| 24 |
random_movies = random_selection(movies_df)
|
| 25 |
|
|
|
|
| 15 |
return similarity_matrix
|
| 16 |
|
| 17 |
similarity_matrix = calculate_similarity_matrix(genre_df)
|
| 18 |
+
|
| 19 |
def random_selection(movies):
|
| 20 |
random_movies = movies['title'].sample(5).to_numpy()
|
| 21 |
return random_movies
|
| 22 |
+
|
| 23 |
movie = st.text_input("Search for movie")
|
| 24 |
+
|
| 25 |
+
if 'counter' not in st.session_state:
|
| 26 |
+
st.session_state['counter'] = 0
|
| 27 |
+
|
| 28 |
+
if st.button("increment"):
|
| 29 |
+
st.session_state['counter'] += 1
|
| 30 |
+
|
| 31 |
if not movie:
|
| 32 |
random_movies = random_selection(movies_df)
|
| 33 |
|