Batch Zero-Shot Classification (In-Memory)
Source:R/classify-batch.R
hf_classify_zero_shot_batch.RdClassify multiple texts into custom categories in parallel without training.
Usage
hf_classify_zero_shot_batch(
text,
labels,
model = "facebook/bart-large-mnli",
multi_label = FALSE,
token = NULL,
batch_size = 50L,
max_active = 10L,
progress = TRUE
)Arguments
- text
Character vector of text(s) to classify.
- labels
Character vector of candidate labels/categories.
- model
Character string. Model ID from Hugging Face Hub. Default: "facebook/bart-large-mnli".
- multi_label
Logical. If TRUE, allows multiple labels per text. Default: FALSE.
- token
Character string or NULL. API token for authentication.
- batch_size
Integer. Number of texts per API request. Default: 50.
- max_active
Integer. Maximum concurrent requests. Default: 10.
- progress
Logical. Show progress bar. Default: TRUE.