|
|
--- |
|
|
language: |
|
|
- en |
|
|
license: cc-by-4.0 |
|
|
configs: |
|
|
- config_name: default |
|
|
data_files: |
|
|
- split: train |
|
|
path: data/train-* |
|
|
dataset_info: |
|
|
features: |
|
|
- name: category |
|
|
dtype: string |
|
|
- name: question |
|
|
dtype: string |
|
|
- name: choices |
|
|
list: string |
|
|
- name: answer |
|
|
dtype: string |
|
|
splits: |
|
|
- name: train |
|
|
num_bytes: 9883240 |
|
|
num_examples: 49599 |
|
|
download_size: 5546262 |
|
|
dataset_size: 9883240 |
|
|
--- |
|
|
This dataset contains a collection of multiple-choice trivia questions and answers. |
|
|
|
|
|
Source: [https://github.com/uberspot/OpenTriviaQA](https://github.com/uberspot/OpenTriviaQA). |
|
|
|
|
|
Available categories: |
|
|
``` |
|
|
animals (1368 items) |
|
|
brain-teasers (214 items) |
|
|
celebrities (3202 items) |
|
|
entertainment (280 items) |
|
|
for-kids (762 items) |
|
|
general (3293 items) |
|
|
geography (842 items) |
|
|
history (1645 items) |
|
|
hobbies (1242 items) |
|
|
humanities (1098 items) |
|
|
literature (1294 items) |
|
|
movies (4315 items) |
|
|
music (5633 items) |
|
|
newest (3016 items) |
|
|
people (2746 items) |
|
|
rated (2199 items) |
|
|
religion-faith (639 items) |
|
|
science-technology (2487 items) |
|
|
sports (2840 items) |
|
|
television (5232 items) |
|
|
video-games (600 items) |
|
|
world (4890 items) |
|
|
``` |
|
|
|
|
|
### Example Data Instance |
|
|
|
|
|
```json |
|
|
{ |
|
|
"category": "brain-teasers", |
|
|
"question": "Which of these is true about the sleep of zebras?", |
|
|
"choices": [ |
|
|
"All of these", |
|
|
"They sleep standing up.", |
|
|
"They would fall asleep every 5 to 6 hours.", |
|
|
"They need more than 12 hours of sleep a day." |
|
|
], |
|
|
"answer": "They sleep standing up." |
|
|
} |
|
|
``` |
|
|
|
|
|
```python |
|
|
import json |
|
|
from datasets import load_dataset |
|
|
dataset = load_dataset("kth8/OpenTriviaQA") |
|
|
|
|
|
for index, row in enumerate(dataset["train"], start=1): |
|
|
category = row['category'] |
|
|
question = row['question'] |
|
|
choices = row['choices'] |
|
|
answer = row['answer'] |
|
|
row_dict = {"index": index, "question": question, "choices": choices, "answer": answer} |
|
|
print(json.dumps(row_dict)) |
|
|
``` |