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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
- es
|
6 |
+
- ru
|
7 |
+
- de
|
8 |
+
- pl
|
9 |
+
- th
|
10 |
+
- vi
|
11 |
+
- sv
|
12 |
+
- bn
|
13 |
+
- da
|
14 |
+
- he
|
15 |
+
- it
|
16 |
+
- fa
|
17 |
+
- sk
|
18 |
+
- id
|
19 |
+
- nb
|
20 |
+
- el
|
21 |
+
- nl
|
22 |
+
- hu
|
23 |
+
- eu
|
24 |
+
- zh
|
25 |
+
- eo
|
26 |
+
- ja
|
27 |
+
- ca
|
28 |
+
- cs
|
29 |
+
- bg
|
30 |
+
- fi
|
31 |
+
- pt
|
32 |
+
- tr
|
33 |
+
- ro
|
34 |
+
- ar
|
35 |
+
- uk
|
36 |
+
- gl
|
37 |
+
- fr
|
38 |
+
- ko
|
39 |
+
tags:
|
40 |
+
- human-feedback
|
41 |
+
- llama-2
|
42 |
+
size_categories:
|
43 |
+
- 1K<n<10k
|
44 |
+
pretty_name: Filtered OpenAssistant Conversations
|
45 |
---
|
46 |
+
# Chat Fine-tuning Dataset - Guanaco Style
|
47 |
+
This dataset allows for fine-tuning chat models using "### Human:" AND "### Assistant" as the beginning and end of sequence tokens.
|
48 |
+
|
49 |
+
Preparation:
|
50 |
+
|
51 |
+
1. The dataset is cloned from [TimDettmers](https://huggingface.co/datasets/timdettmers/openassistant-guanaco), which itself is a subset of the Open Assistant dataset, which you can find [here](https://huggingface.co/datasets/OpenAssistant/oasst1/tree/main). This subset of the data only contains the highest-rated paths in the conversation tree, with a total of 9,846 samples.
|
52 |
+
1. The dataset was then slightly adjusted to:
|
53 |
+
- if a row of data ends with an assistant response, then "### Human" was additionally added to the end of that row of data.
|
54 |
+
|
55 |
+
Details of the root dataset follow, copied from that repo:
|
56 |
+
|
57 |
+
# OpenAssistant Conversations Dataset (OASST1)
|
58 |
+
|
59 |
+
## Dataset Description
|
60 |
+
|
61 |
+
- **Homepage:** https://www.open-assistant.io/
|
62 |
+
- **Repository:** https://github.com/LAION-AI/Open-Assistant
|
63 |
+
- **Paper:** https://arxiv.org/abs/2304.07327
|
64 |
+
|
65 |
+
### Dataset Summary
|
66 |
+
|
67 |
+
In an effort to democratize research on large-scale alignment, we release OpenAssistant
|
68 |
+
Conversations (OASST1), a human-generated, human-annotated assistant-style conversation
|
69 |
+
corpus consisting of 161,443 messages in 35 different languages, annotated with 461,292
|
70 |
+
quality ratings, resulting in over 10,000 fully annotated conversation trees. The corpus
|
71 |
+
is a product of a worldwide crowd-sourcing effort involving over 13,500 volunteers.
|
72 |
+
|
73 |
+
Please refer to our [paper](https://arxiv.org/abs/2304.07327) for further details.
|
74 |
+
|
75 |
+
### Dataset Structure
|
76 |
+
|
77 |
+
This dataset contains message trees. Each message tree has an initial prompt message as the root node,
|
78 |
+
which can have multiple child messages as replies, and these child messages can have multiple replies.
|
79 |
+
|
80 |
+
All messages have a role property: this can either be "assistant" or "prompter". The roles in
|
81 |
+
conversation threads from prompt to leaf node strictly alternate between "prompter" and "assistant".
|
82 |
+
|
83 |
+
This version of the dataset contains data collected on the [open-assistant.io](https://open-assistant.io/) website until April 12 2023.
|
84 |
+
|
85 |
+
### JSON Example: Message
|
86 |
+
|
87 |
+
For readability, the following JSON examples are shown formatted with indentation on multiple lines.
|
88 |
+
Objects are stored without indentation (on single lines) in the actual jsonl files.
|
89 |
+
|
90 |
+
```json
|
91 |
+
{
|
92 |
+
"message_id": "218440fd-5317-4355-91dc-d001416df62b",
|
93 |
+
"parent_id": "13592dfb-a6f9-4748-a92c-32b34e239bb4",
|
94 |
+
"user_id": "8e95461f-5e94-4d8b-a2fb-d4717ce973e4",
|
95 |
+
"text": "It was the winter of 2035, and artificial intelligence (..)",
|
96 |
+
"role": "assistant",
|
97 |
+
"lang": "en",
|
98 |
+
"review_count": 3,
|
99 |
+
"review_result": true,
|
100 |
+
"deleted": false,
|
101 |
+
"rank": 0,
|
102 |
+
"synthetic": true,
|
103 |
+
"model_name": "oasst-sft-0_3000,max_new_tokens=400 (..)",
|
104 |
+
"labels": {
|
105 |
+
"spam": { "value": 0.0, "count": 3 },
|
106 |
+
"lang_mismatch": { "value": 0.0, "count": 3 },
|
107 |
+
"pii": { "value": 0.0, "count": 3 },
|
108 |
+
"not_appropriate": { "value": 0.0, "count": 3 },
|
109 |
+
"hate_speech": { "value": 0.0, "count": 3 },
|
110 |
+
"sexual_content": { "value": 0.0, "count": 3 },
|
111 |
+
"quality": { "value": 0.416, "count": 3 },
|
112 |
+
"toxicity": { "value": 0.16, "count": 3 },
|
113 |
+
"humor": { "value": 0.0, "count": 3 },
|
114 |
+
"creativity": { "value": 0.33, "count": 3 },
|
115 |
+
"violence": { "value": 0.16, "count": 3 }
|
116 |
+
}
|
117 |
+
}
|
118 |
+
```
|
119 |
+
|
120 |
+
### JSON Example: Conversation Tree
|
121 |
+
|
122 |
+
For readability, only a subset of the message properties is shown here.
|
123 |
+
|
124 |
+
```json
|
125 |
+
{
|
126 |
+
"message_tree_id": "14fbb664-a620-45ce-bee4-7c519b16a793",
|
127 |
+
"tree_state": "ready_for_export",
|
128 |
+
"prompt": {
|
129 |
+
"message_id": "14fbb664-a620-45ce-bee4-7c519b16a793",
|
130 |
+
"text": "Why can't we divide by 0? (..)",
|
131 |
+
"role": "prompter",
|
132 |
+
"lang": "en",
|
133 |
+
"replies": [
|
134 |
+
{
|
135 |
+
"message_id": "894d30b6-56b4-4605-a504-89dd15d4d1c8",
|
136 |
+
"text": "The reason we cannot divide by zero is because (..)",
|
137 |
+
"role": "assistant",
|
138 |
+
"lang": "en",
|
139 |
+
"replies": [
|
140 |
+
// ...
|
141 |
+
]
|
142 |
+
},
|
143 |
+
{
|
144 |
+
"message_id": "84d0913b-0fd9-4508-8ef5-205626a7039d",
|
145 |
+
"text": "The reason that the result of a division by zero is (..)",
|
146 |
+
"role": "assistant",
|
147 |
+
"lang": "en",
|
148 |
+
"replies": [
|
149 |
+
{
|
150 |
+
"message_id": "3352725e-f424-4e3b-a627-b6db831bdbaa",
|
151 |
+
"text": "Math is confusing. Like those weird Irrational (..)",
|
152 |
+
"role": "prompter",
|
153 |
+
"lang": "en",
|
154 |
+
"replies": [
|
155 |
+
{
|
156 |
+
"message_id": "f46207ca-3149-46e9-a466-9163d4ce499c",
|
157 |
+
"text": "Irrational numbers are simply numbers (..)",
|
158 |
+
"role": "assistant",
|
159 |
+
"lang": "en",
|
160 |
+
"replies": []
|
161 |
+
},
|
162 |
+
// ...
|
163 |
+
]
|
164 |
+
}
|
165 |
+
]
|
166 |
+
}
|
167 |
+
]
|
168 |
+
}
|
169 |
+
}
|
170 |
+
```
|
171 |
+
|
172 |
+
Please refer to [oasst-data](https://github.com/LAION-AI/Open-Assistant/tree/main/oasst-data) for
|
173 |
+
details about the data structure and Python code to read and write jsonl files containing oasst data objects.
|
174 |
+
|
175 |
+
If you would like to explore the dataset yourself you can find a
|
176 |
+
[`getting-started`](https://github.com/LAION-AI/Open-Assistant/blob/main/notebooks/openassistant-oasst1/getting-started.ipynb)
|
177 |
+
notebook in the `notebooks/openassistant-oasst1` folder of the [LAION-AI/Open-Assistant](https://github.com/LAION-AI/Open-Assistant)
|
178 |
+
github repository.
|
179 |
+
|
180 |
+
|
181 |
+
## Main Dataset Files
|
182 |
+
|
183 |
+
Conversation data is provided either as nested messages in trees (extension `.trees.jsonl.gz`)
|
184 |
+
or as a flat list (table) of messages (extension `.messages.jsonl.gz`).
|
185 |
+
|
186 |
+
### Ready For Export Trees
|
187 |
+
|
188 |
+
```
|
189 |
+
2023-04-12_oasst_ready.trees.jsonl.gz 10,364 trees with 88,838 total messages
|
190 |
+
2023-04-12_oasst_ready.messages.jsonl.gz 88,838 messages
|
191 |
+
```
|
192 |
+
Trees in `ready_for_export` state without spam and deleted messages including message labels.
|
193 |
+
The oasst_ready-trees file usually is sufficient for supervised fine-tuning (SFT) & reward model (RM) training.
|
194 |
+
### All Trees
|
195 |
+
```
|
196 |
+
2023-04-12_oasst_all.trees.jsonl.gz 66,497 trees with 161,443 total messages
|
197 |
+
2023-04-12_oasst_all.messages.jsonl.gz 161,443 messages
|
198 |
+
```
|
199 |
+
All trees, including those in states `prompt_lottery_waiting` (trees that consist of only one message, namely the initial prompt),
|
200 |
+
`aborted_low_grade` (trees that stopped growing because the messages had low quality), and `halted_by_moderator`.
|
201 |
+
### Supplemental Exports: Spam & Prompts
|
202 |
+
```
|
203 |
+
2023-04-12_oasst_spam.messages.jsonl.gz
|
204 |
+
```
|
205 |
+
These are messages which were deleted or have a negative review result (`"review_result": false`).
|
206 |
+
Besides low quality, a frequent reason for message deletion is a wrong language tag.
|
207 |
+
|
208 |
+
```
|
209 |
+
2023-04-12_oasst_prompts.messages.jsonl.gz
|
210 |
+
```
|
211 |
+
These are all the kept initial prompt messages with positive review result (no spam) of trees in `ready_for_export` or `prompt_lottery_waiting` state.
|
212 |
+
|
213 |
+
### Using the Huggingface Datasets
|
214 |
+
|
215 |
+
While HF datasets is ideal for tabular datasets, it is not a natural fit for nested data structures like the OpenAssistant conversation trees.
|
216 |
+
Nevertheless, we make all messages which can also be found in the file `2023-04-12_oasst_ready.trees.jsonl.gz` available in parquet as train/validation splits.
|
217 |
+
These are directly loadable by [Huggingface Datasets](https://pypi.org/project/datasets/).
|
218 |
+
|
219 |
+
To load the oasst1 train & validation splits use:
|
220 |
+
|
221 |
+
```python
|
222 |
+
from datasets import load_dataset
|
223 |
+
ds = load_dataset("OpenAssistant/oasst1")
|
224 |
+
train = ds['train'] # len(train)=84437 (95%)
|
225 |
+
val = ds['validation'] # len(val)=4401 (5%)
|
226 |
+
```
|
227 |
+
|
228 |
+
The messages appear in depth-first order of the message trees.
|
229 |
+
|
230 |
+
Full conversation trees can be reconstructed from the flat messages table by using the `parent_id`
|
231 |
+
and `message_id` properties to identify the parent-child relationship of messages. The `message_tree_id`
|
232 |
+
and `tree_state` properties (only present in flat messages files) can be used to find all messages of a message tree or to select trees by their state.
|
233 |
+
|
234 |
+
### Languages
|
235 |
+
|
236 |
+
OpenAssistant Conversations incorporates 35 different languages with a distribution of messages as follows:
|
237 |
+
|
238 |
+
**Languages with over 1000 messages**
|
239 |
+
- English: 71956
|
240 |
+
- Spanish: 43061
|
241 |
+
- Russian: 9089
|
242 |
+
- German: 5279
|
243 |
+
- Chinese: 4962
|
244 |
+
- French: 4251
|
245 |
+
- Thai: 3042
|
246 |
+
- Portuguese (Brazil): 2969
|
247 |
+
- Catalan: 2260
|
248 |
+
- Korean: 1553
|
249 |
+
- Ukrainian: 1352
|
250 |
+
- Italian: 1320
|
251 |
+
- Japanese: 1018
|
252 |
+
|
253 |
+
<details>
|
254 |
+
<summary><b>Languages with under 1000 messages</b></summary>
|
255 |
+
<ul>
|
256 |
+
<li>Vietnamese: 952</li>
|
257 |
+
<li>Basque: 947</li>
|
258 |
+
<li>Polish: 886</li>
|
259 |
+
<li>Hungarian: 811</li>
|
260 |
+
<li>Arabic: 666</li>
|
261 |
+
<li>Dutch: 628</li>
|
262 |
+
<li>Swedish: 512</li>
|
263 |
+
<li>Turkish: 454</li>
|
264 |
+
<li>Finnish: 386</li>
|
265 |
+
<li>Czech: 372</li>
|
266 |
+
<li>Danish: 358</li>
|
267 |
+
<li>Galician: 339</li>
|
268 |
+
<li>Hebrew: 255</li>
|
269 |
+
<li>Romanian: 200</li>
|
270 |
+
<li>Norwegian Bokmål: 133</li>
|
271 |
+
<li>Indonesian: 115</li>
|
272 |
+
<li>Bulgarian: 95</li>
|
273 |
+
<li>Bengali: 82</li>
|
274 |
+
<li>Persian: 72</li>
|
275 |
+
<li>Greek: 66</li>
|
276 |
+
<li>Esperanto: 59</li>
|
277 |
+
<li>Slovak: 19</li>
|
278 |
+
</ul>
|
279 |
+
</details>
|
280 |
+
## Contact
|
281 |
+
|
282 |
+
- Discord [Open Assistant Discord Server](https://ykilcher.com/open-assistant-discord)
|
283 |
+
- GitHub: [LAION-AI/Open-Assistant](https://github.com/LAION-AI/Open-Assistant)
|
284 |
+
- E-Mail: [open-assistant@laion.ai](mailto:open-assistant@laion.ai)
|