SiddharthAK commited on
Commit
2b6efc2
·
verified ·
1 Parent(s): 795a6cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -227,7 +227,7 @@ def get_splade_doc_representation(text):
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
233
 
@@ -348,7 +348,7 @@ def format_sparse_vector_output(splade_vector, tokenizer, is_binary=False):
348
 
349
  # This is the line that will now always be split into two
350
  info_output = f"Total non-zero terms: {len(indices)}\n" # Line 1
351
- info_output += f"Sparsity: {1 - (len(indices) / tokenizer.vocab_size):.2%}\n" # Line 2
352
 
353
  return formatted_output, info_output
354
 
 
227
  formatted_output += ", ".join(terms_list) + "."
228
 
229
  info_output = f"" # Line 1
230
+ info_output += f"Total activated terms: {len(indices)}" # Line 2
231
 
232
  return formatted_output, info_output
233
 
 
348
 
349
  # This is the line that will now always be split into two
350
  info_output = f"Total non-zero terms: {len(indices)}\n" # Line 1
351
+
352
 
353
  return formatted_output, info_output
354