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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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
---
license: mit
dataset_info:
- config_name: 100_tos
  features:
  - name: document
    dtype: string
  splits:
  - name: train
    num_bytes: 5240826
    num_examples: 92
  download_size: 2497746
  dataset_size: 5240826
- config_name: 10_tos
  features:
  - name: document
    dtype: string
  splits:
  - name: train
    num_bytes: 1920213
    num_examples: 20
  download_size: 718890
  dataset_size: 1920213
- config_name: 142_tos
  features:
  - name: document
    dtype: string
  splits:
  - name: train
    num_bytes: 12968483
    num_examples: 140
  download_size: 4884205
  dataset_size: 12968483
- config_name: cuad
  features:
  - name: document
    dtype: string
  splits:
  - name: train
    num_bytes: 1180620
    num_examples: 28
  download_size: 484787
  dataset_size: 1180620
- config_name: memnet_tos
  features:
  - name: document
    dtype: string
  splits:
  - name: train
    num_bytes: 5607746
    num_examples: 100
  download_size: 2012157
  dataset_size: 5607746
- config_name: multilingual_unfair_clause
  features:
  - name: document
    dtype: string
  splits:
  - name: train
    num_bytes: 22775210
    num_examples: 200
  download_size: 9557263
  dataset_size: 22775210
- config_name: polisis
  features:
  - name: document
    dtype: string
  splits:
  - name: train
    num_bytes: 3137858
    num_examples: 4570
  - name: validation
    num_bytes: 802441
    num_examples: 1153
  - name: test
    num_bytes: 967678
    num_examples: 1446
  download_size: 1827549
  dataset_size: 4907977
- config_name: privacy_glue__piextract
  features:
  - name: document
    dtype: string
  splits:
  - name: validation
    num_bytes: 7106934
    num_examples: 4116
  - name: train
    num_bytes: 18497078
    num_examples: 12140
  download_size: 5707087
  dataset_size: 25604012
- config_name: privacy_glue__policy_detection
  features:
  - name: document
    dtype: string
  splits:
  - name: train
    num_bytes: 13657226
    num_examples: 1301
  download_size: 6937382
  dataset_size: 13657226
- config_name: privacy_glue__policy_ie
  features:
  - name: type_i
    dtype: string
  - name: type_ii
    dtype: string
  splits:
  - name: test
    num_bytes: 645788
    num_examples: 6
  - name: train
    num_bytes: 2707213
    num_examples: 25
  download_size: 1097051
  dataset_size: 3353001
- config_name: privacy_glue__policy_qa
  features:
  - name: document
    dtype: string
  splits:
  - name: test
    num_bytes: 1353787
    num_examples: 20
  - name: dev
    num_bytes: 1230490
    num_examples: 20
  - name: train
    num_bytes: 5441319
    num_examples: 75
  download_size: 2418472
  dataset_size: 8025596
- config_name: privacy_glue__polisis
  features:
  - name: document
    dtype: string
  splits:
  - name: train
    num_bytes: 3073878
    num_examples: 4570
  - name: validation
    num_bytes: 786299
    num_examples: 1153
  - name: test
    num_bytes: 947434
    num_examples: 1446
  download_size: 1816140
  dataset_size: 4807611
- config_name: privacy_glue__privacy_qa
  features:
  - name: document
    dtype: string
  splits:
  - name: train
    num_bytes: 12099109
    num_examples: 27
  - name: test
    num_bytes: 4468753
    num_examples: 8
  download_size: 1221943
  dataset_size: 16567862
configs:
- config_name: 100_tos
  data_files:
  - split: train
    path: 100_tos/train-*
- config_name: 10_tos
  data_files:
  - split: train
    path: 10_tos/train-*
- config_name: 142_tos
  data_files:
  - split: train
    path: 142_tos/train-*
- config_name: cuad
  data_files:
  - split: train
    path: cuad/train-*
- config_name: memnet_tos
  data_files:
  - split: train
    path: memnet_tos/train-*
- config_name: multilingual_unfair_clause
  data_files:
  - split: train
    path: multilingual_unfair_clause/train-*
- config_name: polisis
  data_files:
  - split: train
    path: privacy_glue/polisis/train-*
  - split: validation
    path: privacy_glue/polisis/validation-*
  - split: test
    path: privacy_glue/polisis/test-*
- config_name: privacy_glue__piextract
  data_files:
  - split: validation
    path: privacy_glue/piextract/validation-*
  - split: train
    path: privacy_glue/piextract/train-*
- config_name: privacy_glue__policy_detection
  data_files:
  - split: train
    path: privacy_glue/policy_detection/train-*
- config_name: privacy_glue__policy_ie
  data_files:
  - split: test
    path: privacy_glue/policy_ie/test-*
  - split: train
    path: privacy_glue/policy_ie/train-*
- config_name: privacy_glue__policy_qa
  data_files:
  - split: test
    path: privacy_glue/policy_qa/test-*
  - split: dev
    path: privacy_glue/policy_qa/dev-*
  - split: train
    path: privacy_glue/policy_qa/train-*
- config_name: privacy_glue__polisis
  data_files:
  - split: train
    path: privacy_glue/polisis/train-*
  - split: validation
    path: privacy_glue/polisis/validation-*
  - split: test
    path: privacy_glue/polisis/test-*
- config_name: privacy_glue__privacy_qa
  data_files:
  - split: train
    path: privacy_glue/privacy_qa/train-*
  - split: test
    path: privacy_glue/privacy_qa/test-*
---

# A collection of Terms of Service or Privacy Policy datasets

## Annotated datasets

### CUAD

Specifically, the 28 service agreements from [CUAD](https://www.atticusprojectai.org/cuad), which are licensed under CC BY 4.0 (subset: `cuad`).

<details>
<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentQA

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "cuad")

print(DocumentQA.model_validate_json(ds["document"][0]))
```

</details>

### 100 ToS

From [Annotated 100 ToS](https://data.mendeley.com/datasets/dtbj87j937/3), CC BY 4.0 (subset: `100_tos`).

<details>
<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentEUConsumerLawAnnotation

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "100_tos")

print(DocumentEUConsumerLawAnnotation.model_validate_json(ds["document"][0]))
```

</details>

### Multilingual Unfair Clause

From [CLAUDETTE](http://claudette.eui.eu/corpora/index.html)/[Multilingual Unfair Clause](https://github.com/nlp-unibo/Multilingual-Unfair-Clause-Detection), CC BY 4.0 (subset: `multilingual_unfair_clause`).

It was built from [CLAUDETTE](http://claudette.eui.eu/corpora/index.html)/[25 Terms of Service in English, Italian, German, and Polish (100 documents in total) from A Corpus for Multilingual Analysis of Online Terms of Service](http://claudette.eui.eu/corpus_multilingual_NLLP2021.zip).

<details>
<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentClassification

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "multilingual_unfair_clause")

print(DocumentClassification.model_validate_json(ds["document"][0]))
```

</details>

### Memnet ToS

From [100 Terms of Service in English from Detecting and explaining unfairness in consumer contracts through memory networks](https://github.com/federicoruggeri/Memnet_ToS), MIT (subset: `memnet_tos`).

<details>

<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentClassification

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "memnet_tos")

print(DocumentClassification.model_validate_json(ds["document"][0]))
```

</details>

### 142 ToS

From [142 Terms of Service in English divided according to market sector from Assessing the Cross-Market Generalization Capability of the CLAUDETTE System](http://claudette.eui.eu/corpus_142_ToS.zip), Unknown (subset: `142_tos`). This should also includes [50 Terms of Service in English from "CLAUDETTE: an Automated Detector of Potentially Unfair Clauses in Online Terms of Service"](http://claudette.eui.eu/ToS.zip).

<details>
<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentClassification

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "142_tos")

print(DocumentClassification.model_validate_json(ds["document"][0]))
```

</details>

### 10 ToS/PP

From [5 Terms of Service and 5 Privacy Policies in English and German (10 documents in total) from Cross-lingual Annotation Projection in Legal Texts](https://bitbucket.org/a-galaxy/cross-lingual-annotation-projection-in-legal-texts), GNU GPL 3.0 (subset: `10_tos`)

<details>
<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentClassification

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "10_tos")

print(DocumentClassification.model_validate_json(ds["document"][0]))
```

</details>

### PolicyQA

> [!IMPORTANT]
> This dataset seems to have some annotation issues where __unanswerable__ questions are still answered with SQuAD-v1 format instead of the v2 format.

From [PolicyQA](https://github.com/wasiahmad/PolicyQA), MIT (subset: `privacy_glue/policy_qa`).

<details>
<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentQA

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "privacy_glue/policy_qa")

print(DocumentQA.model_validate_json(ds["train"]["document"][0]))
```

</details>

### PolicyIE

From [PolicyIE](https://github.com/wasiahmad/PolicyIE), MIT (subset: `privacy_glue/policy_ie`).

<details>
<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentSequenceClassification, DocumentEvent

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "privacy_glue/policy_ie")

print(DocumentSequenceClassification.model_validate_json(ds["train"]["type_i"][0]))
print(DocumentEvent.model_validate_json(ds["train"]["type_ii"][0]))
```

</details>

### Policy Detection

From [policy-detection-data](<https://github.com/infsys-lab/policy-detection-data>, GPL 3.0 (subset: `privacy_glue/policy_detection`).

<details>
<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentClassification

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "privacy_glue/policy_detection")

print(DocumentClassification.model_validate_json(ds["train"]["document"][0]))
```

</details>

### Polisis

From [Polisis](https://github.com/SmartDataAnalytics/Polisis_Benchmark), Unknown (subset: `privacy_glue/polisis`).

<details>
<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentClassification

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "privacy_glue/polisis")

print(DocumentClassification.model_validate_json(ds["test"]["document"][0]))
```

</details>

### PrivacyQA

From [PrivacyQA](https://github.com/AbhilashaRavichander/PrivacyQA_EMNLP), MIT (subset: `privacy_qa`).

<details>
<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentClassification

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "privacy_glue/privacy_qa")

print(DocumentClassification.model_validate_json(ds["test"]["document"][0]))
```

</details>

### Piextract

From [Piextract](https://github.com/um-rtcl/piextract_dataset), Unknown (subset: `privacy_glue/piextract`).

<details>
<summary>Code</summary>

```python
import datasets
from tos_datasets.proto import DocumentSequenceClassification

ds = datasets.load_dataset("chenghao/tos_pp_dataset", "privacy_glue/piextract")

print(DocumentSequenceClassification.model_validate_json(ds["train"]["document"][0]))
```

</details>

## WIP

- <del>[Annotated Italian TOS sentences](https://github.com/i3-fbk/LLM-PE_Terms_and_Conditions_Contracts), Apache 2.0</del> Only sentence level annotations, missing original full text
- <del>[Huggingface](https://huggingface.co/datasets/CodeHima/TOS_Dataset), MIT</del> Only sentence level annotations, missing original full text
- [ ] [ToSDR API](https://developers.tosdr.org/dev/get-service-v2), Unknown