hf_ez_text_classification | R Documentation |
Usually used for sentiment-analysis this will output the likelihood of classes of an input.
hf_ez_text_classification( model_id = "distilbert-base-uncased-finetuned-sst-2-english", use_api = FALSE )
model_id |
A model_id. Run hf_search_models(...) for model_ids. Defaults to 'distilbert-base-uncased-finetuned-sst-2-english'. |
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 text classification object
https://huggingface.co/docs/api-inference/detailed_parameters#text-classification-task
## Not run: # Load the default model and use local inference ez <- hf_ez_text_classification() ez$infer(string = c('I like you. I love you'), flatten = FALSE) # Use the api for inference. ez <- hf_ez_text_classification(use_api = TRUE) ez$infer(string = c('I like you. I love you'), flatten = FALSE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.