oneryalcin commited on
Commit
e025ace
·
verified ·
1 Parent(s): 16cbe15

Clarify query and document encoder usage

Browse files
Files changed (1) hide show
  1. README.md +11 -0
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: