Skip to contents

Authentication

Set up and verify your Hugging Face API token.

hf_set_token()
Set Hugging Face API Token
hf_whoami()
Get Current Hugging Face User Information

Text Classification

Classify text using pre-trained models or custom label sets.

hf_classify()
Text Classification
hf_classify_zero_shot()
Zero-Shot Classification

Embeddings and Similarity

Generate vector representations and measure semantic relatedness.

hf_embed()
Generate Text Embeddings
hf_similarity()
Compute Pairwise Similarity
hf_embed_umap()
Dimensionality Reduction with UMAP

Tidytext Integration

Embed, search, cluster, and extract topics from data frames.

hf_embed_text()
Embed Text with Tidytext Compatibility
hf_nearest_neighbors()
Find Nearest Neighbors by Semantic Similarity
hf_cluster_texts()
Cluster Texts by Semantic Similarity
hf_extract_topics()
Extract Semantic Topics from Text

Chat and Conversations

Interact with open-source language models.

hf_chat()
LLM Chat Interface
hf_conversation()
Multi-turn Conversation
chat()
Continue a Conversation

Text Generation

Generate and complete text with language models.

hf_generate()
Text Generation
hf_fill_mask()
Fill Mask

Hub Discovery

Search models and datasets on the Hugging Face Hub.

hf_search_models()
Search Models on Hugging Face Hub
hf_model_info()
Get Model Information
hf_list_tasks()
List Available Tasks
hf_search_datasets()
Search Datasets on Hugging Face Hub
hf_dataset_info()
Get Dataset Information

Datasets

Load dataset rows from the Hub into tibbles.

hf_load_dataset()
Load Dataset via Hugging Face Datasets Server API

Tidymodels

Use embeddings as features in tidymodels recipes.

Legacy Functions

Functions from earlier versions. These may require Python/reticulate.

hf_ez_conversational()
Create a Conversational Agent
hf_ez_conversational_api_inference()
Conversational API Inference
hf_ez_conversational_local_inference()
Conversational Local Inference
hf_ez_fill_mask()
Perform Fill-in-the-Blank Tasks
hf_ez_fill_mask_api_inference()
Fill Mask API Inference
hf_ez_fill_mask_local_inference()
Fill Mask Local Inference
hf_ez_question_answering()
Answer Questions about a Text based on Context
hf_ez_question_answering_api_inference()
Question Answering API Inference
hf_ez_question_answering_local_inference()
Question Answering Local Inference
hf_ez_sentence_similarity()
Compare Sentence Similarity Semantically
hf_ez_sentence_similarity_api_inference()
Sentence Similarity API Inference
hf_ez_sentence_similarity_local_inference()
Sentence Similarity Local Inference
hf_ez_summarization()
Summarize a Text
hf_ez_summarization_api_inference()
Summarization API Inference
hf_ez_summarization_local_inference()
Summarization Local Inference
hf_ez_table_question_answering()
Answer Questions about a Data Table
hf_ez_table_question_answering_api_inference()
Table Question Answering API Inference
hf_ez_table_question_answering_local_inference()
Table Question Answering Local Inference
hf_ez_text2text_generation()
Answer General Questions
hf_ez_text2text_generation_api_inference()
Text2Text Generation API Inference
hf_ez_text2text_generation_local_inference()
Text2Text Generation Local Inference
hf_ez_text_classification()
Classify Texts into Pre-trained Categories
hf_ez_text_classification_api_inference()
Text Classification API Inference
hf_ez_text_classification_local_inference()
Text Classification Local Inference
hf_ez_text_generation()
Generate Text from a Prompt
hf_ez_text_generation_api_inference()
Text Generation API Inference
hf_ez_text_generation_local_inference()
Text Generation Local Inference
hf_ez_token_classification()
Classify parts of a Text
hf_ez_token_classification_api_inference()
Token Classification API Inference
hf_ez_token_classification_local_inference()
Token Classification Local Inference
hf_ez_translation()
Translate between Languages
hf_ez_translation_api_inference()
Translation API Inference
hf_ez_translation_local_inference()
Translation Local Inference
hf_ez_zero_shot_classification()
Perform Text Classification with No Context Required
hf_ez_zero_shot_classification_api_inference()
Zero Shot Classification API Inference
hf_ez_zero_shot_classification_local_inference()
Zero Shot Classification Local Inference
hf_load_tokenizer()
Load an AutoTokenizer from a pre-tained model
hf_load_model()
Load a pre-trained AutoModel object from Hugging Face
hf_load_AutoModel_for_task()
Import a pre-trained AutoModel object for a specific task.
hf_load_pipeline()
Load a pipeline object from Hugging Face - pipelines usually include a model, tokenizer and task.
hf_load_sentence_model()
Load a Sentence Transformers model to extract sentence/document embeddings
hf_list_authors()
List Authors
hf_list_datasets()
List Datasets
hf_list_languages()
List Languages
hf_list_libraries()
List Libraries
hf_list_licenses()
List Licenses
hf_list_models()
List Models
hf_inference()
Inference using a downloaded Hugging Face model or pipeline, or using the Inference API
hf_sentence_encode()
Use a Sentence Transformers pipeline to extract document(s)/sentence(s) embedding(s)
hf_set_device()
Try to set device to GPU for accelerated computation
hf_python_depends()
Install Python Dependencies
hf_fill_mask_payload()
Fill Mask Task Payload
hf_question_answering_payload()
Question Answering Payload
hf_sentence_similarity_payload()
Sentence Similarity Payload
hf_summarization_payload()
Summarization Task Payload
hf_table_question_answering_payload()
Table Question Answering Payload
hf_text2text_generation_payload()
Text2Text Generation Payload
hf_text_classification_payload()
Text Classification Payload
hf_text_generation_payload()
Text Generation Payload
hf_token_classification_payload()
Token Classification Payload
hf_translation_payload()
Translation Payload
hf_zero_shot_classification_payload()
Zero Shot Classification Payload
models_with_downloads
Dataset of model names, tasks & download info
`%>%`
Pipe operator