TransformersZeroShotTextRouter Parameters

Learn how to customize TransformersZeroShotTextRouter.

YAML Init Parameters

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

ParameterTypePossible valuesDescription
labelsList of stringsThe set of possible class labels to classify each sequence into. Can be a single label, a string of comma-separated labels, or a list of labels.
Required.
multi_labelBooleanTrue, False
Default: False
Whether or not multiple candidate labels can be true. If False, the scores are normalized such that the sum of the label likelihoods for each sequence is 1. If True, the labels are considered independent, and probabilities are normalized for each candidate by doing a softmax of the entailment score vs. the contradiction score.
Required.
modelStringDefault: MoritzLaurer/deberta-v3-base-zeroshot-v1.1-all-33 zero-shotThe name or path of a Hugging Face model for zero-shot text classification. Required.
deviceComponentDeviceDefault: NoneThe device on which the model is loaded. If None, the default device is automatically selected. If a device/device map is specified in huggingface_pipeline_kwargs, it overrides this parameter. Optional.
tokenSecretDefault: Secret.from_env_var("HF_API_TOKEN", strict=False)The API token used to download private models from Hugging Face. If token is set to True, the token generated when running transformers-cli login (stored in ~/.huggingface) is used. Optional.
huggingface_pipeline_kwargsDictionary of string and anyDefault: NoneDictionary containing keyword arguments used to initialize the Hugging Face pipeline for zero shot text classification. 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.