Convert dataset to Parquet

#1
by SaylorTwift HF Staff - opened
Files changed (48) hide show
  1. README.md +228 -0
  2. all/test-00000-of-00001.parquet +3 -0
  3. all/train-00000-of-00002.parquet +3 -0
  4. all/train-00001-of-00002.parquet +3 -0
  5. all/validation-00000-of-00001.parquet +3 -0
  6. case_hold/test-00000-of-00001.parquet +3 -0
  7. case_hold/test.jsonl +0 -0
  8. case_hold/train-00000-of-00001.parquet +3 -0
  9. case_hold/train.jsonl +0 -0
  10. case_hold/validation-00000-of-00001.parquet +3 -0
  11. case_hold/validation.jsonl +0 -0
  12. ecthr_a/test-00000-of-00001.parquet +3 -0
  13. ecthr_a/test.jsonl +0 -0
  14. ecthr_a/train-00000-of-00001.parquet +3 -0
  15. ecthr_a/train.jsonl +0 -0
  16. ecthr_a/validation-00000-of-00001.parquet +3 -0
  17. ecthr_a/validation.jsonl +0 -0
  18. ecthr_b/test-00000-of-00001.parquet +3 -0
  19. ecthr_b/test.jsonl +0 -0
  20. ecthr_b/train-00000-of-00001.parquet +3 -0
  21. ecthr_b/train.jsonl +0 -0
  22. ecthr_b/validation-00000-of-00001.parquet +3 -0
  23. ecthr_b/validation.jsonl +0 -0
  24. eurlex/test-00000-of-00001.parquet +3 -0
  25. eurlex/test.jsonl +0 -0
  26. eurlex/train-00000-of-00001.parquet +3 -0
  27. eurlex/train.jsonl +0 -0
  28. eurlex/validation-00000-of-00001.parquet +3 -0
  29. eurlex/validation.jsonl +0 -0
  30. ledgar/test-00000-of-00001.parquet +3 -0
  31. ledgar/test.jsonl +0 -0
  32. ledgar/train-00000-of-00001.parquet +3 -0
  33. ledgar/train.jsonl +0 -0
  34. ledgar/validation-00000-of-00001.parquet +3 -0
  35. ledgar/validation.jsonl +0 -0
  36. lexglue.py +0 -572
  37. scotus/test-00000-of-00001.parquet +3 -0
  38. scotus/test.jsonl +0 -0
  39. scotus/train-00000-of-00001.parquet +3 -0
  40. scotus/train.jsonl +0 -0
  41. scotus/validation-00000-of-00001.parquet +3 -0
  42. scotus/validation.jsonl +0 -0
  43. unfair_tos/test-00000-of-00001.parquet +3 -0
  44. unfair_tos/test.jsonl +0 -0
  45. unfair_tos/train-00000-of-00001.parquet +3 -0
  46. unfair_tos/train.jsonl +0 -0
  47. unfair_tos/validation-00000-of-00001.parquet +3 -0
  48. unfair_tos/validation.jsonl +0 -0
README.md ADDED
@@ -0,0 +1,228 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ dataset_info:
3
+ - config_name: all
4
+ features:
5
+ - name: input
6
+ dtype: string
7
+ - name: references
8
+ sequence: string
9
+ - name: gold
10
+ sequence: string
11
+ splits:
12
+ - name: train
13
+ num_bytes: 911549030
14
+ num_examples: 188532
15
+ - name: validation
16
+ num_bytes: 159553657
17
+ num_examples: 24575
18
+ - name: test
19
+ num_bytes: 179174253
20
+ num_examples: 23607
21
+ download_size: 567419419
22
+ dataset_size: 1250276940
23
+ - config_name: case_hold
24
+ features:
25
+ - name: input
26
+ dtype: string
27
+ - name: references
28
+ sequence: string
29
+ - name: gold
30
+ sequence: string
31
+ splits:
32
+ - name: train
33
+ num_bytes: 76401706
34
+ num_examples: 45000
35
+ - name: validation
36
+ num_bytes: 6615003
37
+ num_examples: 3900
38
+ - name: test
39
+ num_bytes: 6119552
40
+ num_examples: 3600
41
+ download_size: 48281911
42
+ dataset_size: 89136261
43
+ - config_name: ecthr_a
44
+ features:
45
+ - name: input
46
+ dtype: string
47
+ - name: references
48
+ sequence: string
49
+ - name: gold
50
+ sequence: string
51
+ splits:
52
+ - name: train
53
+ num_bytes: 89562863
54
+ num_examples: 9000
55
+ - name: validation
56
+ num_bytes: 10975834
57
+ num_examples: 1000
58
+ - name: test
59
+ num_bytes: 11871882
60
+ num_examples: 1000
61
+ download_size: 52346441
62
+ dataset_size: 112410579
63
+ - config_name: ecthr_b
64
+ features:
65
+ - name: input
66
+ dtype: string
67
+ - name: references
68
+ sequence: string
69
+ - name: gold
70
+ sequence: string
71
+ splits:
72
+ - name: train
73
+ num_bytes: 89566128
74
+ num_examples: 9000
75
+ - name: validation
76
+ num_bytes: 10975713
77
+ num_examples: 1000
78
+ - name: test
79
+ num_bytes: 11871939
80
+ num_examples: 1000
81
+ download_size: 52347621
82
+ dataset_size: 112413780
83
+ - config_name: eurlex
84
+ features:
85
+ - name: input
86
+ dtype: string
87
+ - name: references
88
+ sequence: string
89
+ - name: gold
90
+ sequence: string
91
+ splits:
92
+ - name: train
93
+ num_bytes: 402315088
94
+ num_examples: 55000
95
+ - name: validation
96
+ num_bytes: 42602306
97
+ num_examples: 5000
98
+ - name: test
99
+ num_bytes: 60800017
100
+ num_examples: 5000
101
+ download_size: 210059741
102
+ dataset_size: 505717411
103
+ - config_name: ledgar
104
+ features:
105
+ - name: input
106
+ dtype: string
107
+ - name: references
108
+ sequence: string
109
+ - name: gold
110
+ sequence: string
111
+ splits:
112
+ - name: train
113
+ num_bytes: 72965170
114
+ num_examples: 60000
115
+ - name: validation
116
+ num_bytes: 12077509
117
+ num_examples: 10000
118
+ - name: test
119
+ num_bytes: 11784093
120
+ num_examples: 10000
121
+ download_size: 29866590
122
+ dataset_size: 96826772
123
+ - config_name: scotus
124
+ features:
125
+ - name: input
126
+ dtype: string
127
+ - name: references
128
+ sequence: string
129
+ - name: gold
130
+ sequence: string
131
+ splits:
132
+ - name: train
133
+ num_bytes: 179329783
134
+ num_examples: 5000
135
+ - name: validation
136
+ num_bytes: 75703988
137
+ num_examples: 1400
138
+ - name: test
139
+ num_bytes: 76317017
140
+ num_examples: 1400
141
+ download_size: 173457949
142
+ dataset_size: 331350788
143
+ - config_name: unfair_tos
144
+ features:
145
+ - name: input
146
+ dtype: string
147
+ - name: references
148
+ sequence: string
149
+ - name: gold
150
+ sequence: string
151
+ splits:
152
+ - name: train
153
+ num_bytes: 1408292
154
+ num_examples: 5532
155
+ - name: validation
156
+ num_bytes: 603304
157
+ num_examples: 2275
158
+ - name: test
159
+ num_bytes: 409753
160
+ num_examples: 1607
161
+ download_size: 906648
162
+ dataset_size: 2421349
163
+ configs:
164
+ - config_name: all
165
+ data_files:
166
+ - split: train
167
+ path: all/train-*
168
+ - split: validation
169
+ path: all/validation-*
170
+ - split: test
171
+ path: all/test-*
172
+ - config_name: case_hold
173
+ data_files:
174
+ - split: train
175
+ path: case_hold/train-*
176
+ - split: validation
177
+ path: case_hold/validation-*
178
+ - split: test
179
+ path: case_hold/test-*
180
+ - config_name: ecthr_a
181
+ data_files:
182
+ - split: train
183
+ path: ecthr_a/train-*
184
+ - split: validation
185
+ path: ecthr_a/validation-*
186
+ - split: test
187
+ path: ecthr_a/test-*
188
+ - config_name: ecthr_b
189
+ data_files:
190
+ - split: train
191
+ path: ecthr_b/train-*
192
+ - split: validation
193
+ path: ecthr_b/validation-*
194
+ - split: test
195
+ path: ecthr_b/test-*
196
+ - config_name: eurlex
197
+ data_files:
198
+ - split: train
199
+ path: eurlex/train-*
200
+ - split: validation
201
+ path: eurlex/validation-*
202
+ - split: test
203
+ path: eurlex/test-*
204
+ - config_name: ledgar
205
+ data_files:
206
+ - split: train
207
+ path: ledgar/train-*
208
+ - split: validation
209
+ path: ledgar/validation-*
210
+ - split: test
211
+ path: ledgar/test-*
212
+ - config_name: scotus
213
+ data_files:
214
+ - split: train
215
+ path: scotus/train-*
216
+ - split: validation
217
+ path: scotus/validation-*
218
+ - split: test
219
+ path: scotus/test-*
220
+ - config_name: unfair_tos
221
+ data_files:
222
+ - split: train
223
+ path: unfair_tos/train-*
224
+ - split: validation
225
+ path: unfair_tos/validation-*
226
+ - split: test
227
+ path: unfair_tos/test-*
228
+ ---
all/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eab2cd5c88b255584949508fa6d16ee0e09b51b9fb1fc21161fcb3dd44287e64
3
+ size 82616893
all/train-00000-of-00002.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4fd12f25cd54fc1d06f195c4cf5ebf84e8cae8cc86fb147bf202f480c7ecc8fd
3
+ size 352122885
all/train-00001-of-00002.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a317e94e48c0fda348ea1617d77bdabb0946fd38a24e15689006422ba6415c3e
3
+ size 58518223
all/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c15e2ae1a9d05e81adcd6d8d45927918e7a34f7a7217f4b8c9ae6aeaf8f2683
3
+ size 74161418
case_hold/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72d153c6e78fa02eb3556e9eb72acd817434909f83bc6f6689f8d0b0b57e5115
3
+ size 3317155
case_hold/test.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
case_hold/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a65e3b9669021520659948cc92a06f5005a9b6b39c03293f67d6a8f9ba92df4
3
+ size 41380374
case_hold/train.jsonl DELETED
Binary file (78.3 MB)
 
case_hold/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b817b4eea589ea9d09592dbec7feed0eba2754b4478f6f60212d5534c6901b0a
3
+ size 3584382
case_hold/validation.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
ecthr_a/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00a7063fd74350e451947464e0742ceec3bf9516fb59eae89e44c63474fc7501
3
+ size 5582227
ecthr_a/test.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
ecthr_a/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0caafd371122c7b6bcb2c4c6e9cd8e0f87a45dde92599206ef2e57d48276fbaa
3
+ size 41600873
ecthr_a/train.jsonl DELETED
Binary file (91.3 MB)
 
ecthr_a/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:939af14d8b2256c485a8e816502d9bad7ba9f58f3cb7c5e2477b0fa808f37c97
3
+ size 5163341
ecthr_a/validation.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
ecthr_b/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27ef6aa79821e5d722de94eded6048667b3281f8508f0b832e2e5b2caa93af86
3
+ size 5582343
ecthr_b/test.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
ecthr_b/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e43b76d05c58b123b4cc31680e237c677871fc6e8e87d1a294bb0acf34858502
3
+ size 41601847
ecthr_b/train.jsonl DELETED
Binary file (91.3 MB)
 
ecthr_b/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02b6470a376b5b5e0fa8ed0a3680a6ffc09f49b7fae9186c0d25ad58c1136083
3
+ size 5163431
ecthr_b/validation.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
eurlex/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08b894e7549e7b033cf617345b04dd73cdee8872480e7698f434f1b9694b9195
3
+ size 24433609
eurlex/test.jsonl DELETED
Binary file (61.6 MB)
 
eurlex/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ecaabad600f5380aa0647eb6b7de21e9881caa56c64e1bd17bfebd466b85b2c6
3
+ size 168407772
eurlex/train.jsonl DELETED
Binary file (408 MB)
 
eurlex/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6880f160dd610c861304ea67addcb28e803dd951620bae0db1866bd0f0f9917
3
+ size 17218360
eurlex/validation.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
ledgar/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:691a054f4b1753cb99981d9d133df9574d5563f7e8aaff20d27911e3f9c40a9f
3
+ size 3582775
ledgar/test.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
ledgar/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dfb33e1247db20fbfc959cc3bd38ac6a72daf062c5236a0d2ec83ffdc8e1835e
3
+ size 22568693
ledgar/train.jsonl DELETED
Binary file (75.1 MB)
 
ledgar/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:27685084268f9df1347bfe95d06a38adedaa731f8e53303eff9d77b982d3be31
3
+ size 3715122
ledgar/validation.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
lexglue.py DELETED
@@ -1,572 +0,0 @@
1
- # coding=utf-8
2
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
- """LexGLUE: A Benchmark Dataset for Legal Language Understanding in English."""
16
-
17
- import csv
18
- import json
19
- import textwrap
20
-
21
- import datasets
22
- import os
23
-
24
- MAIN_CITATION = """\
25
- @article{chalkidis-etal-2021-lexglue,
26
- title={{LexGLUE}: A Benchmark Dataset for Legal Language Understanding in English},
27
- author={Chalkidis, Ilias and
28
- Jana, Abhik and
29
- Hartung, Dirk and
30
- Bommarito, Michael and
31
- Androutsopoulos, Ion and
32
- Katz, Daniel Martin and
33
- Aletras, Nikolaos},
34
- year={2021},
35
- eprint={2110.00976},
36
- archivePrefix={arXiv},
37
- primaryClass={cs.CL},
38
- note = {arXiv: 2110.00976},
39
- }"""
40
-
41
- _DESCRIPTION = """\
42
- Legal General Language Understanding Evaluation (LexGLUE) benchmark is
43
- a collection of datasets for evaluating model performance across a diverse set of legal NLU tasks
44
- """
45
-
46
- ECTHR_ARTICLES = ["2", "3", "5", "6", "8", "9", "10", "11", "14", "P1-1"]
47
-
48
- EUROVOC_CONCEPTS = [
49
- "100163",
50
- "100168",
51
- "100169",
52
- "100170",
53
- "100171",
54
- "100172",
55
- "100173",
56
- "100174",
57
- "100175",
58
- "100176",
59
- "100177",
60
- "100179",
61
- "100180",
62
- "100183",
63
- "100184",
64
- "100185",
65
- "100186",
66
- "100187",
67
- "100189",
68
- "100190",
69
- "100191",
70
- "100192",
71
- "100193",
72
- "100194",
73
- "100195",
74
- "100196",
75
- "100197",
76
- "100198",
77
- "100199",
78
- "100200",
79
- "100201",
80
- "100202",
81
- "100204",
82
- "100205",
83
- "100206",
84
- "100207",
85
- "100212",
86
- "100214",
87
- "100215",
88
- "100220",
89
- "100221",
90
- "100222",
91
- "100223",
92
- "100224",
93
- "100226",
94
- "100227",
95
- "100229",
96
- "100230",
97
- "100231",
98
- "100232",
99
- "100233",
100
- "100234",
101
- "100235",
102
- "100237",
103
- "100238",
104
- "100239",
105
- "100240",
106
- "100241",
107
- "100242",
108
- "100243",
109
- "100244",
110
- "100245",
111
- "100246",
112
- "100247",
113
- "100248",
114
- "100249",
115
- "100250",
116
- "100252",
117
- "100253",
118
- "100254",
119
- "100255",
120
- "100256",
121
- "100257",
122
- "100258",
123
- "100259",
124
- "100260",
125
- "100261",
126
- "100262",
127
- "100263",
128
- "100264",
129
- "100265",
130
- "100266",
131
- "100268",
132
- "100269",
133
- "100270",
134
- "100271",
135
- "100272",
136
- "100273",
137
- "100274",
138
- "100275",
139
- "100276",
140
- "100277",
141
- "100278",
142
- "100279",
143
- "100280",
144
- "100281",
145
- "100282",
146
- "100283",
147
- "100284",
148
- "100285",
149
- ]
150
-
151
- LEDGAR_CATEGORIES = [
152
- "Adjustments",
153
- "Agreements",
154
- "Amendments",
155
- "Anti-Corruption Laws",
156
- "Applicable Laws",
157
- "Approvals",
158
- "Arbitration",
159
- "Assignments",
160
- "Assigns",
161
- "Authority",
162
- "Authorizations",
163
- "Base Salary",
164
- "Benefits",
165
- "Binding Effects",
166
- "Books",
167
- "Brokers",
168
- "Capitalization",
169
- "Change In Control",
170
- "Closings",
171
- "Compliance With Laws",
172
- "Confidentiality",
173
- "Consent To Jurisdiction",
174
- "Consents",
175
- "Construction",
176
- "Cooperation",
177
- "Costs",
178
- "Counterparts",
179
- "Death",
180
- "Defined Terms",
181
- "Definitions",
182
- "Disability",
183
- "Disclosures",
184
- "Duties",
185
- "Effective Dates",
186
- "Effectiveness",
187
- "Employment",
188
- "Enforceability",
189
- "Enforcements",
190
- "Entire Agreements",
191
- "Erisa",
192
- "Existence",
193
- "Expenses",
194
- "Fees",
195
- "Financial Statements",
196
- "Forfeitures",
197
- "Further Assurances",
198
- "General",
199
- "Governing Laws",
200
- "Headings",
201
- "Indemnifications",
202
- "Indemnity",
203
- "Insurances",
204
- "Integration",
205
- "Intellectual Property",
206
- "Interests",
207
- "Interpretations",
208
- "Jurisdictions",
209
- "Liens",
210
- "Litigations",
211
- "Miscellaneous",
212
- "Modifications",
213
- "No Conflicts",
214
- "No Defaults",
215
- "No Waivers",
216
- "Non-Disparagement",
217
- "Notices",
218
- "Organizations",
219
- "Participations",
220
- "Payments",
221
- "Positions",
222
- "Powers",
223
- "Publicity",
224
- "Qualifications",
225
- "Records",
226
- "Releases",
227
- "Remedies",
228
- "Representations",
229
- "Sales",
230
- "Sanctions",
231
- "Severability",
232
- "Solvency",
233
- "Specific Performance",
234
- "Submission To Jurisdiction",
235
- "Subsidiaries",
236
- "Successors",
237
- "Survival",
238
- "Tax Withholdings",
239
- "Taxes",
240
- "Terminations",
241
- "Terms",
242
- "Titles",
243
- "Transactions With Affiliates",
244
- "Use Of Proceeds",
245
- "Vacations",
246
- "Venues",
247
- "Vesting",
248
- "Waiver Of Jury Trials",
249
- "Waivers",
250
- "Warranties",
251
- "Withholdings",
252
- ]
253
-
254
- SCDB_ISSUE_AREAS = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"]
255
-
256
- UNFAIR_CATEGORIES = [
257
- "Limitation of liability",
258
- "Unilateral termination",
259
- "Unilateral change",
260
- "Content removal",
261
- "Contract by using",
262
- "Choice of law",
263
- "Jurisdiction",
264
- "Arbitration",
265
- ]
266
-
267
- CASEHOLD_LABELS = ["0", "1", "2", "3", "4"]
268
-
269
-
270
- class LexGlueConfig(datasets.BuilderConfig):
271
- """BuilderConfig for LexGLUE."""
272
-
273
- def __init__(
274
- self,
275
- url,
276
- data_url,
277
- data_file,
278
- citation,
279
- **kwargs,
280
- ):
281
- """BuilderConfig for LexGLUE.
282
-
283
- Args:
284
- text_column: ``string`, name of the column in the jsonl file corresponding
285
- to the text
286
- label_column: `string`, name of the column in the jsonl file corresponding
287
- to the label
288
- url: `string`, url for the original project
289
- data_url: `string`, url to download the zip file from
290
- data_file: `string`, filename for data set
291
- citation: `string`, citation for the data set
292
- url: `string`, url for information about the data set
293
- label_classes: `list[string]`, the list of classes if the label is
294
- categorical. If not provided, then the label will be of type
295
- `datasets.Value('float32')`.
296
- multi_label: `boolean`, True if the task is multi-label
297
- dev_column: `string`, name for the development subset
298
- **kwargs: keyword arguments forwarded to super.
299
- """
300
- super(LexGlueConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
301
- self.url = url
302
- self.data_url = data_url
303
- self.data_file = data_file
304
- self.citation = citation
305
-
306
-
307
- class LexGLUE(datasets.GeneratorBasedBuilder):
308
- """LexGLUE: A Benchmark Dataset for Legal Language Understanding in English. Version 1.0"""
309
-
310
- BUILDER_CONFIGS = [
311
-
312
- LexGlueConfig(
313
- name="all",
314
- description="",
315
- data_url="",
316
- data_file="",
317
- url="",
318
- citation=""
319
- ),
320
- LexGlueConfig(
321
- name="ecthr_a",
322
- description=textwrap.dedent(
323
- """\
324
- The European Court of Human Rights (ECtHR) hears allegations that a state has
325
- breached human rights provisions of the European Convention of Human Rights (ECHR).
326
- For each case, the dataset provides a list of factual paragraphs (facts) from the case description.
327
- Each case is mapped to articles of the ECHR that were violated (if any)."""
328
- ),
329
- data_url="https://zenodo.org/record/5532997/files/ecthr.tar.gz",
330
- data_file="ecthr.jsonl",
331
- url="https://archive.org/details/ECtHR-NAACL2021",
332
- citation=textwrap.dedent(
333
- """\
334
- @inproceedings{chalkidis-etal-2021-paragraph,
335
- title = "Paragraph-level Rationale Extraction through Regularization: A case study on {E}uropean Court of Human Rights Cases",
336
- author = "Chalkidis, Ilias and
337
- Fergadiotis, Manos and
338
- Tsarapatsanis, Dimitrios and
339
- Aletras, Nikolaos and
340
- Androutsopoulos, Ion and
341
- Malakasiotis, Prodromos",
342
- booktitle = "Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies",
343
- month = jun,
344
- year = "2021",
345
- address = "Online",
346
- publisher = "Association for Computational Linguistics",
347
- url = "https://aclanthology.org/2021.naacl-main.22",
348
- doi = "10.18653/v1/2021.naacl-main.22",
349
- pages = "226--241",
350
- }
351
- }"""
352
- ),
353
- ),
354
- LexGlueConfig(
355
- name="ecthr_b",
356
- description=textwrap.dedent(
357
- """\
358
- The European Court of Human Rights (ECtHR) hears allegations that a state has
359
- breached human rights provisions of the European Convention of Human Rights (ECHR).
360
- For each case, the dataset provides a list of factual paragraphs (facts) from the case description.
361
- Each case is mapped to articles of ECHR that were allegedly violated (considered by the court)."""
362
- ),
363
- url="https://archive.org/details/ECtHR-NAACL2021",
364
- data_url="https://zenodo.org/record/5532997/files/ecthr.tar.gz",
365
- data_file="ecthr.jsonl",
366
- citation=textwrap.dedent(
367
- """\
368
- @inproceedings{chalkidis-etal-2021-paragraph,
369
- title = "Paragraph-level Rationale Extraction through Regularization: A case study on {E}uropean Court of Human Rights Cases",
370
- author = "Chalkidis, Ilias
371
- and Fergadiotis, Manos
372
- and Tsarapatsanis, Dimitrios
373
- and Aletras, Nikolaos
374
- and Androutsopoulos, Ion
375
- and Malakasiotis, Prodromos",
376
- booktitle = "Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies",
377
- year = "2021",
378
- address = "Online",
379
- url = "https://aclanthology.org/2021.naacl-main.22",
380
- }
381
- }"""
382
- ),
383
- ),
384
- LexGlueConfig(
385
- name="eurlex",
386
- description=textwrap.dedent(
387
- """\
388
- European Union (EU) legislation is published in EUR-Lex portal.
389
- All EU laws are annotated by EU's Publications Office with multiple concepts from the EuroVoc thesaurus,
390
- a multilingual thesaurus maintained by the Publications Office.
391
- The current version of EuroVoc contains more than 7k concepts referring to various activities
392
- of the EU and its Member States (e.g., economics, health-care, trade).
393
- Given a document, the task is to predict its EuroVoc labels (concepts)."""
394
- ),
395
- url="https://zenodo.org/record/5363165#.YVJOAi8RqaA",
396
- data_url="https://zenodo.org/record/5532997/files/eurlex.tar.gz",
397
- data_file="eurlex.jsonl",
398
- citation=textwrap.dedent(
399
- """\
400
- @inproceedings{chalkidis-etal-2021-multieurlex,
401
- author = {Chalkidis, Ilias and
402
- Fergadiotis, Manos and
403
- Androutsopoulos, Ion},
404
- title = {MultiEURLEX -- A multi-lingual and multi-label legal document
405
- classification dataset for zero-shot cross-lingual transfer},
406
- booktitle = {Proceedings of the 2021 Conference on Empirical Methods
407
- in Natural Language Processing},
408
- year = {2021},
409
- location = {Punta Cana, Dominican Republic},
410
- }
411
- }"""
412
- ),
413
- ),
414
- LexGlueConfig(
415
- name="scotus",
416
- description=textwrap.dedent(
417
- """\
418
- The US Supreme Court (SCOTUS) is the highest federal court in the United States of America
419
- and generally hears only the most controversial or otherwise complex cases which have not
420
- been sufficiently well solved by lower courts. This is a single-label multi-class classification
421
- task, where given a document (court opinion), the task is to predict the relevant issue areas.
422
- The 14 issue areas cluster 278 issues whose focus is on the subject matter of the controversy (dispute)."""
423
- ),
424
- url="http://scdb.wustl.edu/data.php",
425
- data_url="https://zenodo.org/record/5532997/files/scotus.tar.gz",
426
- data_file="scotus.jsonl",
427
- citation=textwrap.dedent(
428
- """\
429
- @misc{spaeth2020,
430
- author = {Harold J. Spaeth and Lee Epstein and Andrew D. Martin, Jeffrey A. Segal
431
- and Theodore J. Ruger and Sara C. Benesh},
432
- year = {2020},
433
- title ={{Supreme Court Database, Version 2020 Release 01}},
434
- url= {http://Supremecourtdatabase.org},
435
- howpublished={Washington University Law}
436
- }"""
437
- ),
438
- ),
439
- LexGlueConfig(
440
- name="ledgar",
441
- description=textwrap.dedent(
442
- """\
443
- LEDGAR dataset aims contract provision (paragraph) classification.
444
- The contract provisions come from contracts obtained from the US Securities and Exchange Commission (SEC)
445
- filings, which are publicly available from EDGAR. Each label represents the single main topic
446
- (theme) of the corresponding contract provision."""
447
- ),
448
- url="https://metatext.io/datasets/ledgar",
449
- data_url="https://zenodo.org/record/5532997/files/ledgar.tar.gz",
450
- data_file="ledgar.jsonl",
451
- citation=textwrap.dedent(
452
- """\
453
- @inproceedings{tuggener-etal-2020-ledgar,
454
- title = "{LEDGAR}: A Large-Scale Multi-label Corpus for Text Classification of Legal Provisions in Contracts",
455
- author = {Tuggener, Don and
456
- von D{\"a}niken, Pius and
457
- Peetz, Thomas and
458
- Cieliebak, Mark},
459
- booktitle = "Proceedings of the 12th Language Resources and Evaluation Conference",
460
- year = "2020",
461
- address = "Marseille, France",
462
- url = "https://aclanthology.org/2020.lrec-1.155",
463
- }
464
- }"""
465
- ),
466
- ),
467
- LexGlueConfig(
468
- name="unfair_tos",
469
- description=textwrap.dedent(
470
- """\
471
- The UNFAIR-ToS dataset contains 50 Terms of Service (ToS) from on-line platforms (e.g., YouTube,
472
- Ebay, Facebook, etc.). The dataset has been annotated on the sentence-level with 8 types of
473
- unfair contractual terms (sentences), meaning terms that potentially violate user rights
474
- according to the European consumer law."""
475
- ),
476
- url="http://claudette.eui.eu",
477
- data_url="https://zenodo.org/record/5532997/files/unfair_tos.tar.gz",
478
- data_file="unfair_tos.jsonl",
479
- citation=textwrap.dedent(
480
- """\
481
- @article{lippi-etal-2019-claudette,
482
- title = "{CLAUDETTE}: an automated detector of potentially unfair clauses in online terms of service",
483
- author = {Lippi, Marco
484
- and Pałka, Przemysław
485
- and Contissa, Giuseppe
486
- and Lagioia, Francesca
487
- and Micklitz, Hans-Wolfgang
488
- and Sartor, Giovanni
489
- and Torroni, Paolo},
490
- journal = "Artificial Intelligence and Law",
491
- year = "2019",
492
- publisher = "Springer",
493
- url = "https://doi.org/10.1007/s10506-019-09243-2",
494
- pages = "117--139",
495
- }"""
496
- ),
497
- ),
498
- LexGlueConfig(
499
- name="case_hold",
500
- description=textwrap.dedent(
501
- """\
502
- The CaseHOLD (Case Holdings on Legal Decisions) dataset contains approx. 53k multiple choice
503
- questions about holdings of US court cases from the Harvard Law Library case law corpus.
504
- Holdings are short summaries of legal rulings accompany referenced decisions relevant for the present case.
505
- The input consists of an excerpt (or prompt) from a court decision, containing a reference
506
- to a particular case, while the holding statement is masked out. The model must identify
507
- the correct (masked) holding statement from a selection of five choices."""
508
- ),
509
- url="https://github.com/reglab/casehold",
510
- data_url="https://zenodo.org/record/5532997/files/casehold.tar.gz",
511
- data_file="casehold.csv",
512
- citation=textwrap.dedent(
513
- """\
514
- @inproceedings{Zheng2021,
515
- author = {Lucia Zheng and
516
- Neel Guha and
517
- Brandon R. Anderson and
518
- Peter Henderson and
519
- Daniel E. Ho},
520
- title = {When Does Pretraining Help? Assessing Self-Supervised Learning for
521
- Law and the CaseHOLD Dataset},
522
- year = {2021},
523
- booktitle = {International Conference on Artificial Intelligence and Law},
524
- }"""
525
- ),
526
- ),
527
- ]
528
-
529
- def _info(self):
530
- return datasets.DatasetInfo(
531
- description=self.config.description,
532
- features=datasets.Features({
533
- "input": datasets.Value("string"),
534
- "references": datasets.features.Sequence(datasets.Value("string")),
535
- "gold": datasets.features.Sequence(datasets.Value("string"))
536
-
537
- }),
538
- homepage=self.config.url,
539
- citation=self.config.citation + "\n" + MAIN_CITATION,
540
- )
541
-
542
- def _split_generators(self, dl_manager):
543
- if self.config.name == "all":
544
- test = [dl_manager.download(os.path.join(name, "test.jsonl")) for name in ["ecthr_a", "ecthr_b", "scotus", "eurlex", "ledgar", "unfair_tos", "case_hold"]]
545
- train = [dl_manager.download(os.path.join(name, "train.jsonl")) for name in ["ecthr_a", "ecthr_b", "scotus", "eurlex", "ledgar", "unfair_tos", "case_hold"]]
546
- val = [dl_manager.download(os.path.join(name, "validation.jsonl")) for name in ["ecthr_a", "ecthr_b", "scotus", "eurlex", "ledgar", "unfair_tos", "case_hold"]]
547
- else:
548
- test = [dl_manager.download(os.path.join(self.config.name, "test.jsonl"))]
549
- train = [dl_manager.download(os.path.join(self.config.name, "train.jsonl"))]
550
- val = [dl_manager.download(os.path.join(self.config.name, "validation.jsonl"))]
551
-
552
- return [
553
- datasets.SplitGenerator(
554
- name=datasets.Split.TRAIN,
555
- gen_kwargs={"files": train},
556
- ),
557
- datasets.SplitGenerator(
558
- name=datasets.Split.VALIDATION,
559
- gen_kwargs={"files": val},
560
- ),
561
- datasets.SplitGenerator(
562
- name=datasets.Split.TEST,
563
- gen_kwargs={"files": test},
564
- ),
565
- ]
566
-
567
- def _generate_examples(self, files):
568
- """This function returns the examples in the raw (text) form."""
569
- for file in files:
570
- with open(file, "r") as f:
571
- for ix, line in enumerate(f):
572
- yield ix, json.loads(line)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scotus/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab8e71d86f7c22b56d878b94f32c883f34b60d1ddbb4ed4252bab7702c9834f8
3
+ size 39979648
scotus/test.jsonl DELETED
Binary file (77.3 MB)
 
scotus/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:65fb5752d9264035bea99c262fb91cadf95408d953e92e96f1fd8952061accc1
3
+ size 94393966
scotus/train.jsonl DELETED
Binary file (182 MB)
 
scotus/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a9b8b9e1ee346b98d919aa7b03e006c70677d90b85f4ea10ec611c2e257db63
3
+ size 39084335
scotus/validation.jsonl DELETED
Binary file (76.7 MB)
 
unfair_tos/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d345c0a3f53cf7380fd9edbbf6af67b704ccf7630e290221feeba7f78df9a67b
3
+ size 153847
unfair_tos/test.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
unfair_tos/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b6741c7550f01e9c97811430e79d656d7130e77a7243b9e226707dd095bae0f5
3
+ size 525188
unfair_tos/train.jsonl DELETED
The diff for this file is too large to render. See raw diff
 
unfair_tos/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc22ff8eea10ac4626d10eb26476d3f4977bd4b64e746aef9143ad12470f8005
3
+ size 227613
unfair_tos/validation.jsonl DELETED
The diff for this file is too large to render. See raw diff