Spaces:
Runtime error
Runtime error
Michelangiolo
commited on
Commit
•
8b29749
1
Parent(s):
d670aa7
changes
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def search(df, query):
|
|
42 |
# product = df.iloc[0]['text_vector_'] #use one of the products as sample
|
43 |
|
44 |
#prepare model
|
45 |
-
nbrs = NearestNeighbors(n_neighbors=
|
46 |
|
47 |
distances, indices = nbrs.kneighbors([product]) #input the vector of the reference object
|
48 |
|
|
|
42 |
# product = df.iloc[0]['text_vector_'] #use one of the products as sample
|
43 |
|
44 |
#prepare model
|
45 |
+
nbrs = NearestNeighbors(n_neighbors=20, algorithm='ball_tree').fit(df['text_vector_'].values.tolist())
|
46 |
|
47 |
distances, indices = nbrs.kneighbors([product]) #input the vector of the reference object
|
48 |
|