ReferencePredictor Parameters

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:

ParameterTypePossible ValuesDescription
model_name_or_pathStringDefault: cross-encoder/ms-marco-MiniLM-L-6-v2The 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_kwargsDictionaryDefault: NoneAdditional parameters you can pass to the ReferencePredictor model.
Optional.
model_versionStringDefault: NoneThe version of the model to use.
Optional.
max_seq_lenIntegerDefault: 512Specifies 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.
languageStringDefault: enThe language of the data for which you want to generate references. It's needed to apply the correct sentence-splitting rules.
Mandatory.
use_gpuBooleanTrue
False
Default: True
Uses a GPU if available. If not, falls back on a CPU.
Mandatory.
batch_sizeIntegerDefault: 16The number of batches to be processed at once. A batch is the number of answers and document spans that get processed.
Mandatory.
answer_window_sizeIntegerDefault: 1The 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_strideIntegerDefault: 1The 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_sizeIntegerDefault: 3The 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_strideIntegerDefault: 3The 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_tokenUnion[string, Boolean]Default: NoneThe token needed to access private models on Hugging Face. Use only if you're using a private model hosted on Hugging Face.
Optional.
devicesList[Union[string, torch.device]]Default: NonePass torch devices or identifiers to determine the device inference should run on.
Optional
function_to_applyStringsigmoid
softmax
none
Default: sigmoid
The activation function to use on top of the logits.
Mandatory.
min_score_2_label_thresholdsDictionaryDefault: NoneThe minimum prediction score threshold for each corresponding label.
Optional.
label_2_score_mapDictionarylabel: 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_thresholdFloatDefault: NoneIf 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_classStringDefault: not_groundedA class to be used if the predicted score doesn't match any threshold.
Mandatory.
verifiability_model_name_or_pathStringDefault: tstadel/answer-classification-setfit-v2-binaryThe 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_kwargsDictionaryDefault: NoneAdditional parameters you can pass to the verifiability model.
Optional.
verifiability_batch_sizeIntegerDefault: 32The batch size to use for verifiability inference.
Mandatory.
needs_verification_classesList of stringsDefault: NoneThe class names to be used to determine if a sentence needs verification. Defaults to ["needs_verification"].
Mandatory.
use_split_rulesBooleanTrue
False
Default: False
Applies additional rules to the sentence-splitting tokenizer to split the answers better.
Mandatory.
extend_abbreviationsBooleanTrue
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.