Tesneem commited on
Commit
0a29d4b
1 Parent(s): 98b94f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -45,9 +45,10 @@ embeddings = np.load("netflix_embeddings.npy") #created using sentence_transfor
45
  metadata = pd.read_csv("netflix_metadata.csv") #created using sentence_transformers on kaggle
46
 
47
  # Vector search function
48
- def vector_search(query,top_n=3):
49
  query_embedding = sentence_model.encode(query)
50
  similarities = cosine_similarity([query_embedding], embeddings)[0]
 
51
  top_indices = similarities.argsort()[-top_n:][::-1]
52
  results = metadata.iloc[top_indices]
53
  result_text=""
 
45
  metadata = pd.read_csv("netflix_metadata.csv") #created using sentence_transformers on kaggle
46
 
47
  # Vector search function
48
+ def vector_search(query,response_amount=3):
49
  query_embedding = sentence_model.encode(query)
50
  similarities = cosine_similarity([query_embedding], embeddings)[0]
51
+ top_n=response_amount
52
  top_indices = similarities.argsort()[-top_n:][::-1]
53
  results = metadata.iloc[top_indices]
54
  result_text=""