hf_ez_zero_shot_classification | R Documentation |
This task is super useful to try out classification with zero code, you simply pass a sentence/paragraph and the possible labels for that sentence, and you get a result.
hf_ez_zero_shot_classification( model_id = "facebook/bart-large-mnli", use_api = FALSE )
model_id |
A model_id. Run hf_search_models(...) for model_ids. Defaults to 'facebook/bart-large-mnli'. |
use_api |
Whether to use the Inference API to run the model (TRUE) or download and run the model locally (FALSE). Defaults to FALSE |
A zero shot classification object
https://huggingface.co/docs/api-inference/detailed_parameters#zero-shot-classification-task
## Not run: # Load the default model ez <- hf_ez_zero_shot_classification() # Classify the string ez$infer(string = "Hi, I recently bought a device from your company but it is not working as advertised and I would like to get reimbursed!", candidate_labels = c("refund", "legal", "faq")) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.