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:

Parameter

Type

Possible values

Description

labels

List of strings

The 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_label

Boolean

True, 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.

model

String

Default: MoritzLaurer/deberta-v3-base-zeroshot-v1.1-all-33 zero-shot

The name or path of a Hugging Face model for zero-shot text classification. Required.

device

ComponentDevice

Default: None

The 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.

token

Secret

Default: 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_kwargs

Dictionary of string and any

Default: None

Dictionary 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.