SiddharthAK commited on
Commit
795a6cd
·
verified ·
1 Parent(s): 6e37521

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -181,7 +181,7 @@ def get_splade_lexical_representation(text):
181
  terms_list.append(f"**{term}**: {weight:.4f}")
182
  formatted_output += ", ".join(terms_list) + "."
183
 
184
- info_output = f"--- Raw Sparse Vector Info ---\n" # Line 1
185
  info_output += f"Total non-zero terms in vector: {len(indices)}\n" # Line 2 (and onwards for sparsity)
186
  info_output += f"Sparsity: {1 - (len(indices) / tokenizer_splade_lexical.vocab_size):.2%}\n"
187
 
@@ -226,7 +226,7 @@ def get_splade_doc_representation(text):
226
  terms_list.append(f"**{term}**")
227
  formatted_output += ", ".join(terms_list) + "."
228
 
229
- info_output = f"--- Raw Binary Bag-of-Words Vector Info ---\n" # Line 1
230
  info_output += f"Total activated terms: {len(indices)} Sparsity: {1 - (len(indices) / tokenizer_splade_doc.vocab_size):.2%}\n" # Line 2
231
 
232
  return formatted_output, info_output
 
181
  terms_list.append(f"**{term}**: {weight:.4f}")
182
  formatted_output += ", ".join(terms_list) + "."
183
 
184
+ info_output = f"" # Line 1
185
  info_output += f"Total non-zero terms in vector: {len(indices)}\n" # Line 2 (and onwards for sparsity)
186
  info_output += f"Sparsity: {1 - (len(indices) / tokenizer_splade_lexical.vocab_size):.2%}\n"
187
 
 
226
  terms_list.append(f"**{term}**")
227
  formatted_output += ", ".join(terms_list) + "."
228
 
229
+ info_output = f"" # Line 1
230
  info_output += f"Total activated terms: {len(indices)} Sparsity: {1 - (len(indices) / tokenizer_splade_doc.vocab_size):.2%}\n" # Line 2
231
 
232
  return formatted_output, info_output