Feature Extraction
sentence-transformers
Safetensors
English
sparse-encoder
splade
sparse-retrieval
opensearch
elasticsearch
financial-filings
Instructions to use oneryalcin/financial-filings-sparse-encoder-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use oneryalcin/financial-filings-sparse-encoder-v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("oneryalcin/financial-filings-sparse-encoder-v1") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Clarify query and document encoder usage
Browse files
README.md
CHANGED
|
@@ -22,6 +22,8 @@ This is a Sentence Transformers `SparseEncoder` / SPLADE-style model fine-tuned
|
|
| 22 |
|
| 23 |
The practical recommendation from the experiments below is to index document vectors after **top-128 pruning**. In the current proxy retrieval benchmark, top-128 keeps almost all unpruned quality while reducing each document to about 126 active sparse terms.
|
| 24 |
|
|
|
|
|
|
|
| 25 |
## TL;DR
|
| 26 |
|
| 27 |
| setting | value |
|
|
@@ -64,6 +66,15 @@ opensearch-project/opensearch-neural-sparse-encoding-doc-v2-distill
|
|
| 64 |
|
| 65 |
Reason: it already has separate query/document sparse encoding behavior and is aligned with OpenSearch neural sparse retrieval. Starting here means fine-tuning adapts a serving-compatible sparse model rather than building a new retrieval stack from scratch.
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
## Dataset
|
| 68 |
|
| 69 |
Dataset:
|
|
|
|
| 22 |
|
| 23 |
The practical recommendation from the experiments below is to index document vectors after **top-128 pruning**. In the current proxy retrieval benchmark, top-128 keeps almost all unpruned quality while reducing each document to about 126 active sparse terms.
|
| 24 |
|
| 25 |
+
Naming note: the model is not document-only. It is an asymmetric query/document sparse encoder, following the OpenSearch model-family convention where the heavier document-side path is emphasized. Use `encode_query(...)` for online queries and `encode_document(...)` for offline document/chunk indexing.
|
| 26 |
+
|
| 27 |
## TL;DR
|
| 28 |
|
| 29 |
| setting | value |
|
|
|
|
| 66 |
|
| 67 |
Reason: it already has separate query/document sparse encoding behavior and is aligned with OpenSearch neural sparse retrieval. Starting here means fine-tuning adapts a serving-compatible sparse model rather than building a new retrieval stack from scratch.
|
| 68 |
|
| 69 |
+
The `doc` wording in the base model name does not mean queries are encoded with the document encoder. This model should be used with the routed Sentence Transformers sparse API:
|
| 70 |
+
|
| 71 |
+
```python
|
| 72 |
+
query_vectors = model.encode_query(queries)
|
| 73 |
+
document_vectors = model.encode_document(documents)
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
In practice, query encoding is the lightweight online side, while document encoding is the heavier offline/indexing side. The top-k pruning recommendation applies to document vectors before indexing.
|
| 77 |
+
|
| 78 |
## Dataset
|
| 79 |
|
| 80 |
Dataset:
|