hf_load_dataset: Load a dataset from the Hugging Face Hub!

View source: R/datasets.R

hf_load_datasetR Documentation

Load a dataset from the Hugging Face Hub!

Description

Function has multiple uses - getting pre-made datasets for exploratory analysis, or to figure as means for evaluating your fine-tuned models.

Usage

hf_load_dataset(
  dataset,
  split = NULL,
  label_conversion = c("str2int", "int2str", NULL)
)

Arguments

dataset

The name of a Hugging Face dataset saved on the Hub. Use hf_list_models() to find a dataset.

split

Usually one of 'train' , 'test', 'validation' however, check the dataset's meta data at The Hub first.

label_conversion

Whether to add an additional column converting labels from str2int or int2str?

Value

A Hugging Face data set as a tibble

See Also

https://huggingface.co/docs/datasets/index

Examples

(emo_all_splits <- hf_load_dataset('emo'))

(imdb_train <- hf_load_dataset('imdb', split = "train"))



farach/huggingfaceR documentation built on Feb. 4, 2023, 10:31 p.m.