Spaces:
Running
Running
Update app.py
Browse files
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"
|
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"
|
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
|