TransformersSimilarityRanker Parameters

Learn how to customize TransformersSimiliartyRanker.

YAML Init Parameters

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

ParameterTypePossible valuesDescription
modelUnion of string and pathDefault: "cross-encoder/ms-marco-MiniLM-L-6-v2"The name or path of a pre-trained cross-encoder model from Hugging Face.
Reqiured.
deviceComponentDeviceDefault: NoneThe device on which the model is loaded. If None, the default device is automatically selected.
Optional.
tokenSecretDefault: {"type": "env_var", "env_vars": ["HF_API_TOKEN"], "strict": False}The API token used to download private models from Hugging Face.
Optional.
top_kIntDefault: 10The maximum number of Documents to return per query. 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 reranking models, such as bge.
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, such as bge.
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.
scale_scoreBoolTrue, False
Default: True
Whether the raw logit predictions should be scaled using a Sigmoid activation function. Set this to False if you don't want any scaling of the raw logit predictions.
Required.
calibration_factorFloatDefault: 1.0The factor used for calibrating probabilities calculated by sigmoid(logits * calibration_factor). This is only used if scale_score is set to True.
Optional.
score_thresholdFloatDefault: NoneIf provided, only returns documents with a score above this threshold.
Optional.
model_kwargsDictionary of string and anyDefault: NoneAdditional keyword arguments passed to AutoModelForSequenceClassification.from_pretrained when loading the model specified in model.
Optional.

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.