Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,8 @@ import requests
|
|
7 |
import io
|
8 |
import random
|
9 |
|
10 |
-
input_count =
|
|
|
11 |
|
12 |
# Download and extract the MovieLens dataset
|
13 |
url = 'https://files.grouplens.org/datasets/movielens/ml-latest-small.zip'
|
@@ -43,7 +44,7 @@ def get_recommendations(title, cosine_sim=cosine_sim):
|
|
43 |
sim_scores = sorted(sim_scores, key=lambda x: x[1], reverse=True)
|
44 |
|
45 |
# Get the scores of the 20 most similar movies
|
46 |
-
sim_scores = sim_scores[1:
|
47 |
|
48 |
# Get the movie indices
|
49 |
movie_indices = [i[0] for i in sim_scores]
|
|
|
7 |
import io
|
8 |
import random
|
9 |
|
10 |
+
input_count = 500
|
11 |
+
result_count = 21
|
12 |
|
13 |
# Download and extract the MovieLens dataset
|
14 |
url = 'https://files.grouplens.org/datasets/movielens/ml-latest-small.zip'
|
|
|
44 |
sim_scores = sorted(sim_scores, key=lambda x: x[1], reverse=True)
|
45 |
|
46 |
# Get the scores of the 20 most similar movies
|
47 |
+
sim_scores = sim_scores[1:result_count]
|
48 |
|
49 |
# Get the movie indices
|
50 |
movie_indices = [i[0] for i in sim_scores]
|