Skip to content

Commit deea19c

Browse files
author
Zhe Yu
committed
revert(cli): default to NaiveReranker
1 parent 747e8a0 commit deea19c

3 files changed

Lines changed: 6 additions & 11 deletions

File tree

‎docs/cli.md‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -311,16 +311,11 @@ The JSON configuration file may hold the following values:
311311
guarantees the return of `n` documents, but with the risk of including too
312312
many less-relevant chunks that may affect the document selection. Default:
313313
`-1` (any negative value means selecting documents based on all indexed chunks);
314-
- `reranker`: string, the reranking method to use. Currently supports
315-
`CrossEncoderReranker` (default, using
314+
- `reranker`: string, the reranking method to use. Currently supports `NaiveReranker`
315+
(sort chunks by the "distance" between the embedding vectors) and
316+
`CrossEncoderReranker` (using
316317
[sentence-transformers cross-encoder](https://sbert.net/docs/package_reference/cross_encoder/cross_encoder.html)
317-
) and `NaiveReranker` (sort chunks by the "distance" between the embedding
318-
vectors).
319-
Note: If you're using a good embedding model (eg. a hosted service from OpenAI, or
320-
a LLM-based embedding model like
321-
[Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B)), you
322-
may get better results if you use `NaiveReranker` here because a good embedding
323-
model may understand texts better than a mediocre reranking model.
318+
).
324319
- `reranker_params`: dictionary, similar to `embedding_params`. The options
325320
passed to the reranker class constructor. For `CrossEncoderReranker`, these
326321
are the options passed to the

‎src/vectorcode/cli_utils.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class Config:
100100
overlap_ratio: float = 0.2
101101
query_multiplier: int = -1
102102
query_exclude: list[Union[str, os.PathLike]] = field(default_factory=list)
103-
reranker: Optional[str] = "CrossEncoderReranker"
103+
reranker: Optional[str] = "NaiveReranker"
104104
reranker_params: dict[str, Any] = field(default_factory=lambda: {})
105105
check_item: Optional[str] = None
106106
use_absolute_path: bool = False

‎tests/test_cli_utils.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async def test_config_import_from_missing_keys():
113113
assert config.chunk_size == 2500
114114
assert config.overlap_ratio == 0.2
115115
assert config.query_multiplier == -1
116-
assert config.reranker == "CrossEncoderReranker"
116+
assert config.reranker == "NaiveReranker"
117117
assert config.reranker_params == {}
118118
assert config.db_settings is None
119119

0 commit comments

Comments
 (0)