File size: 1,883 Bytes
0cf41bb
5f856c9
 
0cf41bb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
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))
```