SentenceTransformersDiversityRanker Parameters

Learn how to customize SentenceTransformersDiversityRanker.

YAML Init Parameters

These are the parameters you can pass to this component in the pipeline YAML configuration:

ParameterTypePossible valuesDescription
modelStringDefault: sentence-transformers/all-MiniLM-L6-v2Local path or name of the model in Hugging Face.
Required.
top_kIntegerDefault: 10The maximum number of documents to return per query.
Required.
deviceComponentDeviceDefault: NoneThe device on which the model is loaded. If None, the default device is automatically selected. Optional.
tokenSecretDefault: Secret.from_env_var("HF_API_TOKEN", strict=False)The API token used to download private models from Hugging Face. Optional.
similarityLiteraldot_product
cosine
Default: cosine
Similarity metric for comparing embeddings.
Required.
query_prefixStringDefault: "" (empty string)A string to add to the beginning of the query text before ranking. Can be used to prepend the text with an instruction, as required by some embedding models.
Required.
query_suffixStringDefault: "" (empty string)A string to add to the end of the query text before ranking. Required.
document_prefixStringDefault: "" (empty string)A string to add to the beginning of each document text before ranking. Can be used to prepend the text with an instruction, as required by some embedding models.
Required.
document_suffixStringDefault: "" (empty string)A string to add to the end of each document text before ranking.
Required.
meta_fields_to_embedList of stringsDefault: NoneList of metadata fields that should be embedded along with the document content. Optional.
embedding_separatorStringDefault: "\n"Separator used to concatenate the meta fields to the Document content.
Required.

REST API Runtime Parameters

There are no runtime parameters you can pass to this component when making a request to the Search REST API endpoint.