File size: 853 Bytes
d330ddb
 
6d62ae6
d330ddb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2d593c8
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
---
language: en
license: apache-2.0
---
Based on jokes from [v2.jokeapi.dev](https://v2.jokeapi.dev/). Teach your assistant better jokes.

Each instance follows this format:
```json
{
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "what's a good joke?"
    },
    {
      "role": "assistant",
      "content": "What do Santa's little helpers learn at school? The elf-abet!"
    }
  ],
  "safe": true,
  "category": "Christmas",
  "nsfw": false,
  "religious": false,
  "racist": false,
  "sexist": false,
  "explicit": false
}
```

Use:
```json
import json
import random
from datasets import load_dataset
dataset = load_dataset("kth8/jokes", split="train")
print(dataset)
print(json.dumps(dataset[random.randint(0, dataset.num_rows - 1)], indent=2))
```