Skip to content
Discussion options

You must be logged in to vote

Install the library with pip install datasets, then try this example from the official loading tutorial:

from datasets import load_dataset

ds = load_dataset(
    "cornell-movie-review-data/rotten_tomatoes",
    split="train",
)

print(ds[0])

The first argument is the dataset’s Hub ID. split="train" loads its training set, and ds[0] returns the first example.

Omit split to load all available splits into a DatasetDict, then access one with ds["train"].

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Advait251206
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants