Replies: 1 comment 1 reply
-
Hello, You can use, the following code: from datasets import load_dataset
train_size = 100
valid_size = 10
split = [
f"train[:{train_size}]",
f"validation[:{valid_size}]"
]
SQuAD_train, SQuAD_valid = load_dataset("squad_v2", split=split)
assert SQuAD_train.shape == (100, 5)
assert SQuAD_valid.shape == (10, 5) Find more options in the official documentation. Regards, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am loading the squad_v2 dataset. But I want to use a smaller number of examples in training and testing. I wasn't able to find any help regarding this.
Code is written below:
Is there any possibility to reduce the data size from 130319 to any number x that I want?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions