Reranker#
- class Reranker#
reranker | Rerank first-stage retrieved paragraphs based on the contextualized similarity of query <-> paragraph.
Pass each pair of query/paragraph through a transformer network simultaneously. The reranker produces a score indicating the contextualized similarity per text pair.
Requires a dedicated reranker worker to be registered (learn more).
- pydantic model PluginConfig#
- Fields:
original_score_weight (float)
query (str | None)
rerank_score_mode (squirro.lib.search.relevancy.plugins.rerank.transformer_rerankers.RerankerScoreMode)
reranker_score_weight (float)
top_n_items (int)
worker (str)
-
PluginConfig.plugin_name:
ClassVar
[str
] = 'reranker'# Used to register and reference the plugin within a query.
-
field PluginConfig.query:
Optional
[str
] = ''# left side of the text-pair, as used for contexutalized scoring. Per default fetches to supplied searchbar user-terms
-
field PluginConfig.worker:
str
= 'bge'# What registered reranker worker (@transformer-service) to use.
-
field PluginConfig.rerank_score_mode:
RerankerScoreMode
= RerankerScoreMode.weighted_avg# How to combine the score from the reranker stage with the original score determined by the retriever. Supported options are weighted_avg (leveraging minmax-normalization) and reranker_only.