Check the init and runtime parameters you can pass for the ReferencePredictor node.
YAML Init Parameters
These are the parameters you can specify in pipeline YAML:
Parameter | Type | Possible Values | Description |
---|---|---|---|
model_name_or_path | String | Default: cross-encoder/ms-marco-MiniLM-L-6-v2 | The model you want ReferencePredictor to use. Specify the name identifier of the model from the Hugging Face Hub or the path to a locally saved model. Mandatory. |
model_kwargs | Dictionary | Default: None | Additional parameters you can pass to the ReferencePredictor model. Optional. |
model_version | String | Default: None | The version of the model to use. Optional. |
max_seq_len | Integer | Default: 512 | Specifies the maximum number of tokens the sequence text can have. The sequence text is the answer and the document span combined. Longer sequences are truncated. Mandatory. |
language | String | Default: en | The language of the data for which you want to generate references. It's needed to apply the correct sentence-splitting rules. Mandatory. |
use_gpu | Boolean | True False Default: True | Uses a GPU if available. If not, falls back on a CPU. Mandatory. |
batch_size | Integer | Default: 16 | The number of batches to be processed at once. A batch is the number of answers and document spans that get processed. Mandatory. |
answer_window_size | Integer | Default: 1 | The length of the answer span for which you want ReferencePredictor to generate a reference. The length is in sentences, so setting it to 1 means that the answer span is one sentence, so there'll be a reference generated for each sentence in the answer.If answer_window_size=2 , it means the answer span contains two sentences, so there's a reference generated for each answer span that consists of two sentences.Mandatory. |
answer_stride | Integer | Default: 1 | The number of sentences that overlap between adjacent answer spans. For example, if answer_window_size=3 (meaning the answer span is three sentences) and answer_stride=1 , there is an overlap of one sentence between each answer span. So in this scenario, the first answer span would be sentences 1 to 3, the second answer span would be sentences 2 to 4, the third 3 to 5, and so on.Mandatory. |
document_window_size | Integer | Default: 3 | The length of the document span for which you want ReferencePredictor to generate a reference. The length is in sentences, so setting it to 1 means that the document span is one sentence, so there'll be a reference generated for each sentence in the answer.If document_window_size=3 , it means the document span contains three sentences, so there's a reference generated for each document span that consists of three sentences.Mandatory. |
document_stride | Integer | Default: 3 | The number of sentences that overlap between adjacent document spans. For example, if document_window_size=3 (meaning the document span is three sentences) and document_stride=1 , there is an overlap of one sentence between each document span. So, in this scenario, the first document span would be sentences 1 to 3, the second document span would be sentences 2 to 4, the third 3 to 5, and so on.Mandatory. |
use_auth_token | Union[string, Boolean] | Default: None | The token needed to access private models on Hugging Face. Use only if you're using a private model hosted on Hugging Face. Optional. |
devices | List[Union[string, torch.device]] | Default: None | Pass torch devices or identifiers to determine the device inference should run on. Optional |
function_to_apply | String | sigmoid softmax none Default: sigmoid | The activation function to use on top of the logits. Mandatory. |
min_score_2_label_thresholds | Dictionary | Default: None | The minimum prediction score threshold for each corresponding label. Optional. |
label_2_score_map | Dictionary | label: score (example: positive: 0.75 )Default: None | If using a model with a multi-label prediction head, pass a dictionary mapping label names to a float value that will be used as a score. You do this to make it possible to aggregate and compare scores later on. Optional. |
reference_threshold | Float | Default: None | If you're using this component to generate references for answer spans, you can pass a minimum threshold that determines if you want the model to include a prediction as a reference for the answer or not. If you don't set any threshold, the model chooses the reference by picking the maximum score. Optional. |
default_class | String | Default: not_grounded | A class to be used if the predicted score doesn't match any threshold. Mandatory. |
verifiability_model_name_or_path | String | Default: tstadel/answer-classification-setfit-v2-binary | The name identifier of the verifiability model from Hugging Face or the path to a local model folder. This model verifies which sentences in the answer need verification, rejecting answers that are noise, out of context, or simply information that an answer couldn't be found. This model was trained for English only. For languages other than English, set this parameter to null .Optional |
verifiability_model_kwargs | Dictionary | Default: None | Additional parameters you can pass to the verifiability model. Optional. |
verifiability_batch_size | Integer | Default: 32 | The batch size to use for verifiability inference. Mandatory. |
needs_verification_classes | List of strings | Default: None | The class names to be used to determine if a sentence needs verification. Defaults to ["needs_verification"]. Mandatory. |
use_split_rules | Boolean | True False Default: False | Applies additional rules to the sentence-splitting tokenizer to split the answers better. Mandatory. |
extend_abbreviations | Boolean | True False Default: False | If True, the abbreviations used by NLTK's Punkt tokenizer are extended by a list of curated abbreviations if available. If False, the default abbreviations are used. Mandatory. |
REST API Runtime Parameters
There are no runtime parameters you can pass to this node when making a request to the Search REST API endpoint.