Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -28,11 +28,11 @@ def recommend_image(movie, sim):
|
|
28 |
index = data[data['title'] == movie].index[0]
|
29 |
dist = dict(enumerate(sim[index]))
|
30 |
dist = dict(sorted(dist.items(), reverse=True, key = lambda item: item[1]))
|
31 |
-
#index from 1 because the
|
32 |
cnt = 0
|
33 |
for key in dist:
|
34 |
cnt = cnt+1
|
35 |
-
if cnt <
|
36 |
title = data.iloc[key].title
|
37 |
posterRes, plotRes = get_poster_plot(title)
|
38 |
poster.append(posterRes)
|
|
|
28 |
index = data[data['title'] == movie].index[0]
|
29 |
dist = dict(enumerate(sim[index]))
|
30 |
dist = dict(sorted(dist.items(), reverse=True, key = lambda item: item[1]))
|
31 |
+
#index from 1 because the first is the movie itself
|
32 |
cnt = 0
|
33 |
for key in dist:
|
34 |
cnt = cnt+1
|
35 |
+
if cnt < 10:
|
36 |
title = data.iloc[key].title
|
37 |
posterRes, plotRes = get_poster_plot(title)
|
38 |
poster.append(posterRes)
|