Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -391,6 +391,10 @@ def format_sparse_vector_output(splade_vector, tokenizer, is_binary=False):
|
|
| 391 |
else:
|
| 392 |
terms_list = []
|
| 393 |
for i, (term, weight) in enumerate(sorted_representation):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 394 |
if is_binary:
|
| 395 |
terms_list.append(f"**{term}**")
|
| 396 |
else:
|
|
@@ -579,6 +583,22 @@ with gr.Blocks(title="SPLADE Demos", css=css) as demo:
|
|
| 579 |
outputs=gr.Markdown(),
|
| 580 |
allow_flagging="never"
|
| 581 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 582 |
|
| 583 |
# This block ensures the share URL is captured when the app launches
|
| 584 |
if __name__ == "__main__":
|
|
|
|
| 391 |
else:
|
| 392 |
terms_list = []
|
| 393 |
for i, (term, weight) in enumerate(sorted_representation):
|
| 394 |
+
# Limiting to 50 terms for display to avoid overly long output
|
| 395 |
+
if i >= 50:
|
| 396 |
+
terms_list.append(f"...and {len(sorted_representation) - 50} more terms.")
|
| 397 |
+
break
|
| 398 |
if is_binary:
|
| 399 |
terms_list.append(f"**{term}**")
|
| 400 |
else:
|
|
|
|
| 583 |
outputs=gr.Markdown(),
|
| 584 |
allow_flagging="never"
|
| 585 |
)
|
| 586 |
+
|
| 587 |
+
# --- ADDED CITATION HERE ---
|
| 588 |
+
gr.Markdown(
|
| 589 |
+
"""
|
| 590 |
+
---
|
| 591 |
+
### References
|
| 592 |
+
|
| 593 |
+
This demo utilizes **SPLADE-v3** models. For more details, please refer to the original paper:
|
| 594 |
+
|
| 595 |
+
* **SPLADE-v3: New baselines for SPLADE**
|
| 596 |
+
* Carlos Lassance, Hervé Déjean, Thibault Formal, Stéphane Clinchant
|
| 597 |
+
* arXiv preprint: [2403.06789](https://arxiv.org/abs/2403.06789) (2024)
|
| 598 |
+
* Licensed under Creative Commons Attribution Non Commercial Share Alike 4.0 International.
|
| 599 |
+
"""
|
| 600 |
+
)
|
| 601 |
+
|
| 602 |
|
| 603 |
# This block ensures the share URL is captured when the app launches
|
| 604 |
if __name__ == "__main__":
|