Learn how to customize TransformersSimiliartyRanker.
YAML Init Parameters
These are the parameters you can pass to this component in the pipeline YAML configuration:
Parameter | Type | Possible values | Description |
---|---|---|---|
model | Union of string and path | Default: "cross-encoder/ms-marco-MiniLM-L-6-v2" | The name or path of a pre-trained cross-encoder model from Hugging Face. Reqiured. |
device | ComponentDevice | Default: None | The device on which the model is loaded. If None , the default device is automatically selected.Optional. |
token | Secret | Default: {"type": "env_var", "env_vars": ["HF_API_TOKEN"], "strict": False} | The API token used to download private models from Hugging Face. Optional. |
top_k | Int | Default: 10 | The maximum number of Documents to return per query. Required. |
query_prefix | String | Default: "" (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_prefix | String | Default: "" (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_embed | List of strings | Default: None | List of metadata fields that should be embedded along with the document content. Optional. |
embedding_separator | String | Default: "\n" | Separator used to concatenate the meta fields to the document content. Required. |
scale_score | Bool | True , 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_factor | Float | Default: 1.0 | The factor used for calibrating probabilities calculated by sigmoid(logits * calibration_factor) . This is only used if scale_score is set to True .Optional. |
score_threshold | Float | Default: None | If provided, only returns documents with a score above this threshold. Optional. |
model_kwargs | Dictionary of string and any | Default: None | Additional 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.