Shriharsh commited on
Commit
e637b24
·
verified ·
1 Parent(s): f1dc219

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -118,7 +118,7 @@ def answer_question(question):
118
 
119
  # Compute cosine similarity with stored embeddings
120
  cos_scores = util.cos_sim(question_embedding, embeddings)[0]
121
- top_k = min(2, len(corpus)) # Get top 3 paragraphs to improve accuracy
122
  top_indices = np.argsort(-cos_scores)[:top_k]
123
 
124
  # Retrieve context (top 3 paragraphs)
 
118
 
119
  # Compute cosine similarity with stored embeddings
120
  cos_scores = util.cos_sim(question_embedding, embeddings)[0]
121
+ top_k = min(1, len(corpus)) # Get top 3 paragraphs to improve accuracy
122
  top_indices = np.argsort(-cos_scores)[:top_k]
123
 
124
  # Retrieve context (top 3 paragraphs)