How to prepare local dataset for load_dataset() and mimic its behavior when loading HF's existing online dataset

Hi @vikasy95 yes you can create a Dataset object by using the from_dict() method, e.g.

from datasets import Dataset

data = {"text":["This is a positive sentence", "This is a negative sentence"], "label": [1,0]}
dset = Dataset.from_dict(data)

See the docs for more details :slight_smile:

1 Like