justmotes commited on
Commit
9c3b465
·
verified ·
1 Parent(s): 70193f5

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -334,10 +334,13 @@ def run_benchmark(query):
334
  vectors_scanned_pct = (vectors_scanned / total_vectors) * 100 if total_vectors > 0 else 0
335
 
336
  # Calculate Recall for Optimized (vs Baseline)
337
- prod_ids = set(p.id for p in prod_results)
338
- if base_ids:
339
- intersection = len(base_ids.intersection(prod_ids))
340
- recall = (intersection / len(base_ids)) * 100
 
 
 
341
  else:
342
  recall = 0.0
343
 
 
334
  vectors_scanned_pct = (vectors_scanned / total_vectors) * 100 if total_vectors > 0 else 0
335
 
336
  # Calculate Recall for Optimized (vs Baseline)
337
+ # Use content matching (payload) because IDs might differ if indexed separately
338
+ base_contents = set(p.payload.get('text', str(p.payload)) for p in base_results)
339
+ prod_contents = set(p.payload.get('text', str(p.payload)) for p in prod_results)
340
+
341
+ if base_contents:
342
+ intersection = len(base_contents.intersection(prod_contents))
343
+ recall = (intersection / len(base_contents)) * 100
344
  else:
345
  recall = 0.0
346