Classify text using a Hugging Face model. Commonly used for sentiment analysis, topic classification, etc.
Usage
hf_classify(
text,
model = "distilbert/distilbert-base-uncased-finetuned-sst-2-english",
token = NULL,
...
)Arguments
- text
Character vector of text(s) to classify.
- model
Character string. Model ID from Hugging Face Hub. Default: "distilbert/distilbert-base-uncased-finetuned-sst-2-english" (sentiment analysis).
- token
Character string or NULL. API token for authentication.
- ...
Additional arguments (currently unused).