Load a specific field in load_dataset #7091
Unanswered
SubhashiniRajesh26
asked this question in
Q&A
Replies: 1 comment
-
Yes, simply you can ex: {
"data": [
{
"id": "1",
"text": "I love programming.",
"label": "positive"
},
{
"id": "2",
"text": "I don'like bugs.",
"label": "negative"
}
],
"metadata": {
"version": "1.0",
"source": "generated"
}
}
from datasets import load_dataset
# If you want to load the data field from the JSON file then
dataset = load_dataset('json', data_files='classification.json', field='data')
print(dataset) |
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
-
Is it possible to load only a specific field of json file in load_datset()? Suggestions are most welcome
Beta Was this translation helpful? Give feedback.
All reactions