SiddharthAK commited on
Commit
d3df2dd
·
verified ·
1 Parent(s): 8e4067c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -18
app.py CHANGED
@@ -475,24 +475,13 @@ def calculate_dot_product_and_representations_independent(query_model_choice, do
475
 
476
  # Overlapping Terms Dot Products
477
  if sorted_overlapping_dot_products:
478
- full_output += "### Dot Products of Overlapping Terms:\n"
479
- full_output += "*(Term: Query_Weight x Document_Weight = Product)*\n\n"
480
- overlap_list = []
481
- for term, product_val in sorted_overlapping_dot_products:
482
- # Get individual weights for display
483
- query_weight = query_vector[query_tokenizer.encode(term, add_special_tokens=False)[0]].item()
484
- doc_weight = doc_vector[doc_tokenizer.encode(term, add_special_tokens=False)[0]].item()
485
-
486
- if query_is_binary and doc_is_binary:
487
- overlap_list.append(f"**{term}**: 1.0000 x 1.0000 = {product_val:.4f}")
488
- elif query_is_binary:
489
- overlap_list.append(f"**{term}**: 1.0000 x {doc_weight:.4f} = {product_val:.4f}")
490
- elif doc_is_binary:
491
- overlap_list.append(f"**{term}**: {query_weight:.4f} x 1.0000 = {product_val:.4f}")
492
- else:
493
- overlap_list.append(f"**{term}**: {query_weight:.4f} x {doc_weight:.4f} = {product_val:.4f}")
494
- full_output += ", ".join(overlap_list) + ".\n\n"
495
- full_output += "---\n\n"
496
  else:
497
  full_output += "### No Overlapping Terms Found.\n\n"
498
  full_output += "---\n\n"
 
475
 
476
  # Overlapping Terms Dot Products
477
  if sorted_overlapping_dot_products:
478
+ full_output += "### Dot Products of Overlapping Terms:\n"
479
+ full_output += "\n" # Removed the individual weight explanation
480
+ overlap_list = []
481
+ for term, product_val in sorted_overlapping_dot_products:
482
+ overlap_list.append(f"**{term}**: {product_val:.4f}") # Simplified to just the dot product
483
+ full_output += ", ".join(overlap_list) + ".\n\n"
484
+ full_output += "---\n\n"
 
 
 
 
 
 
 
 
 
 
 
485
  else:
486
  full_output += "### No Overlapping Terms Found.\n\n"
487
  full_output += "---\n\n"